@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');

:root {
    --matrix-green: #00ff41;
    --matrix-dark-green: #003b00;
    --matrix-red: #ff0000;
    --bg-color: #0d0d0d;
    --text-shadow: 0 0 5px var(--matrix-green);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-color);
    color: var(--matrix-green);
    font-family: 'Share Tech Mono', monospace;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 80px; 
    padding-top: 80px;
}

.hidden { display: none !important; }

#matrixCanvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; opacity: 0.25; }

.brand-logo { position: absolute; top: 20px; left: 30px; max-width: 220px; width: 100%; height: auto; z-index: 60; cursor: pointer; mix-blend-mode: screen; transition: transform 0.3s ease; }
.brand-logo:hover { transform: scale(1.05); }

.top-panel { position: absolute; top: 20px; right: 30px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; z-index: 60; }
.auth-buttons { display: flex; gap: 10px; margin-bottom: 5px; }
.lang-switcher { display: flex; gap: 5px; }
.small-btn { padding: 8px 12px; font-size: 0.9rem; border-width: 1px; }
.lang-btn { background: black; color: #555; border: 1px solid #555; padding: 5px 10px; cursor: pointer; font-family: inherit; font-size: 0.8rem; transition: all 0.3s; }
.lang-btn:hover, .lang-btn.active { color: var(--matrix-green); border-color: var(--matrix-green); box-shadow: 0 0 5px var(--matrix-green); }

.container { width: 90%; max-width: 1000px; background: rgba(0, 0, 0, 0.85); border: 1px solid var(--matrix-green); box-shadow: 0 0 20px rgba(0, 255, 65, 0.2); padding: 40px; border-radius: 5px; position: relative; animation: fadeIn 0.5s ease-in-out; margin: 20px auto; }
header { text-align: center; margin-bottom: 30px; border-bottom: 1px dashed var(--matrix-dark-green); padding-bottom: 20px; }
h1 { font-size: 2.5rem; text-shadow: var(--text-shadow); text-transform: uppercase; letter-spacing: 2px; line-height: 1.2; }
#main-subtitle { margin-top: 12px; font-size: clamp(1rem, 2.2vw, 1.25rem); line-height: 1.4; overflow-wrap: anywhere; }

.pills-container { display: flex; justify-content: center; gap: 50px; margin-top: 40px; margin-bottom: 20px; flex-wrap: wrap; }
.pill-wrapper { cursor: pointer; transition: transform 0.3s; }
.pill-wrapper:hover { transform: scale(1.05); }
.pill { width: 180px; height: 60px; border-radius: 30px; position: relative; box-shadow: inset -5px -5px 10px rgba(0,0,0,0.7), inset 5px 5px 10px rgba(255,255,255,0.4), 0 0 15px rgba(0,0,0,0.5); display: flex; justify-content: center; align-items: center; }
.pill span { color: white; font-weight: bold; font-size: 1.1rem; text-shadow: 0 1px 2px rgba(0,0,0,0.8); z-index: 2; text-transform: uppercase; }
.pill.red { background: linear-gradient(135deg, #ff4d4d, #990000); box-shadow: 0 0 20px rgba(255, 0, 0, 0.4), inset -5px -5px 10px rgba(0,0,0,0.5), inset 5px 5px 10px rgba(255,255,255,0.3); border: 1px solid #ff0000; }
.pill.blue { background: linear-gradient(135deg, #4d4dff, #000099); box-shadow: 0 0 20px rgba(0, 0, 255, 0.4), inset -5px -5px 10px rgba(0,0,0,0.5), inset 5px 5px 10px rgba(255,255,255,0.3); border: 1px solid #0000ff; }

.grid-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px; }
.grid-menu .matrix-btn { min-width: 0; min-height: 72px; overflow-wrap: anywhere; }
.grid-menu .matrix-btn > span { min-width: 0; overflow-wrap: anywhere; }
.matrix-btn { background: transparent; color: var(--matrix-green); border: 2px solid var(--matrix-green); padding: 15px 20px; font-family: 'Share Tech Mono', monospace; font-size: 1.1rem; cursor: pointer; transition: all 0.3s ease; text-transform: uppercase; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; text-align: center; }
.matrix-btn:hover { background: var(--matrix-green); color: black; box-shadow: 0 0 15px var(--matrix-green); }
.matrix-btn i { margin-right: 10px; }

.floating-ask-btn { position: fixed; bottom: 30px; right: 30px; background: black; color: var(--matrix-green); border: 2px solid var(--matrix-green); padding: 15px 25px; font-family: 'Share Tech Mono', monospace; font-size: 1rem; cursor: pointer; z-index: 50; box-shadow: 0 0 10px rgba(0, 255, 65, 0.4); border-radius: 30px; transition: transform 0.2s, box-shadow 0.2s; text-transform: uppercase; font-weight: bold; }
.floating-ask-btn:hover { background: var(--matrix-green); color: black; box-shadow: 0 0 20px var(--matrix-green); transform: scale(1.05); }

.content-box { display: flex; flex-direction: row; align-items: center; gap: 40px; }
.visual-representation { flex: 1; text-align: center; font-size: 6rem; padding: 40px; border: 1px solid var(--matrix-dark-green); background: rgba(0, 59, 0, 0.1); animation: pulse 2s infinite; min-height: 250px; display: flex; align-items: center; justify-content: center; }
.text-content { flex: 1.5; display: flex; flex-direction: column; justify-content: center; }
.text-content h3 { font-size: 1.5rem; margin-bottom: 15px; border-bottom: 1px solid var(--matrix-dark-green); display: inline-block; }
.text-content p { line-height: 1.6; font-size: 1.1rem; }
.tech-stack { display: flex; gap: 15px; margin-top: 20px; flex-wrap: wrap; }
.tech-item { border: 1px solid var(--matrix-green); padding: 8px 15px; font-size: 0.9rem; background: rgba(0, 255, 65, 0.05); }
.note { margin-top: 25px; font-size: 0.9rem; opacity: 0.8; font-style: italic; border-left: 3px solid var(--matrix-green); padding-left: 15px; }
.actions { margin-top: 40px; display: flex; justify-content: space-between; gap: 20px; }
.actions button { flex: 1; }
.actions .secondary { border-color: #555; color: #aaa; }
.actions .secondary:hover { background: #555; color: white; box-shadow: none; }

.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.9); display: flex; justify-content: center; align-items: center; z-index: 100; overflow-y: auto; }
.modal-content { background: #000; border: 2px solid var(--matrix-green); padding: 30px; width: 90%; max-width: 500px; box-shadow: 0 0 30px rgba(0, 255, 65, 0.3); position: relative; animation: fadeIn 0.3s; margin: 20px; }
.large-modal { max-width: 800px; }
.text-content-modal { display: flex; flex-direction: column; max-height: 90vh; }

.close-btn { position: absolute; top: 10px; right: 15px; font-size: 2rem; cursor: pointer; color: var(--matrix-green); line-height: 1; z-index: 10; }
.close-btn:hover { color: white; }

form { display: flex; flex-direction: column; gap: 15px; margin-top: 20px; }
input, select, textarea { background: #111; border: 1px solid var(--matrix-green); color: var(--matrix-green); padding: 12px; font-family: 'Share Tech Mono', monospace; outline: none; font-size: 1rem; width: 100%; }
input:focus, textarea:focus, select:focus { box-shadow: 0 0 5px var(--matrix-green); background: #051a05; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid input:nth-last-child(1):nth-child(odd) { grid-column: span 2; } 

.input-error { border: 1px solid var(--matrix-red) !important; box-shadow: 0 0 10px var(--matrix-red), inset 0 0 5px var(--matrix-red) !important; animation: shake 0.3s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25%, 75% { transform: translateX(-5px); } 50% { transform: translateX(5px); } }

.checkbox-group { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.matrix-checkbox { display: block; position: relative; padding-left: 35px; margin-bottom: 12px; cursor: pointer; font-size: 0.9rem; user-select: none; text-align: left; }
.matrix-checkbox input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.checkmark { position: absolute; top: 0; left: 0; height: 20px; width: 20px; background-color: #111; border: 1px solid var(--matrix-green); }
.matrix-checkbox:hover input ~ .checkmark { background-color: #051a05; }
.matrix-checkbox input:checked ~ .checkmark { background-color: var(--matrix-green); }
.checkmark:after { content: ""; position: absolute; display: none; }
.matrix-checkbox input:checked ~ .checkmark:after { display: block; }
.matrix-checkbox .checkmark:after { left: 6px; top: 2px; width: 5px; height: 10px; border: solid black; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.matrix-checkbox a { color: var(--matrix-green); text-decoration: underline; font-weight: bold; }
.matrix-checkbox a:hover { color: white; }

.scrollable-text { flex: 1; overflow-y: auto; min-height: 200px; background: #111; padding: 15px; border: 1px solid #333; margin-top: 30px; text-align: left; font-size: 0.9rem; scrollbar-color: var(--matrix-green) #111; -webkit-overflow-scrolling: touch; }
.scrollable-text::-webkit-scrollbar { width: 10px; }
.scrollable-text::-webkit-scrollbar-track { background: #111; }
.scrollable-text::-webkit-scrollbar-thumb { background: var(--matrix-green); border-radius: 5px; }

/* --- OTP СПЕЦИАЛЬНЫЙ ДИЗАЙН --- */
.otp-modal-content { border: 2px solid var(--matrix-green); }
.otp-header { color: var(--matrix-green); font-size: 1.8rem; text-shadow: 0 0 10px var(--matrix-green); margin-bottom: 20px; text-align: center; }
.otp-disclaimer { font-size: 0.8rem; color: var(--matrix-green); text-align: justify; line-height: 1.4; margin-bottom: 30px; }

/* Контейнер OTP - СТРОКА */
.otp-container { 
    display: flex; 
    flex-direction: row; /* Принудительно в строку */
    justify-content: center; 
    gap: 15px; 
    margin-bottom: 40px; 
    flex-wrap: nowrap; /* Запрет переноса */
}

/* Поля ввода OTP - ВАЖНО: !important чтобы перебить глобальный input width:100% */
.otp-input { 
    width: 60px !important; /* Квадрат */
    height: 60px !important; /* Квадрат */
    font-size: 2rem; 
    text-align: center; 
    border: 2px solid var(--matrix-green); 
    background: black; 
    color: white; 
    font-family: 'Share Tech Mono', monospace; 
    padding: 0;
}
.otp-input:focus { box-shadow: 0 0 15px var(--matrix-green); outline: none; }

.otp-buttons-row { display: flex; justify-content: space-between; gap: 20px; }
.otp-btn-left { flex: 1; background: transparent; border: 1px solid #555; color: #888; padding: 15px; font-family: 'Share Tech Mono', monospace; text-transform: uppercase; cursor: pointer; font-size: 1rem; transition: all 0.3s; }
.otp-btn-left:hover { border-color: var(--matrix-green); color: var(--matrix-green); }
.otp-btn-right { flex: 1; background: transparent; border: 2px solid var(--matrix-green); color: var(--matrix-green); padding: 15px; font-family: 'Share Tech Mono', monospace; text-transform: uppercase; cursor: pointer; font-size: 1rem; box-shadow: 0 0 10px rgba(0, 255, 65, 0.2); transition: all 0.3s; }
.otp-btn-right:hover { background: var(--matrix-green); color: black; box-shadow: 0 0 20px var(--matrix-green); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0% { text-shadow: 0 0 5px var(--matrix-green); box-shadow: 0 0 5px var(--matrix-green) inset; opacity: 0.8; } 50% { text-shadow: 0 0 20px var(--matrix-green); box-shadow: 0 0 15px var(--matrix-green) inset; opacity: 1; } 100% { text-shadow: 0 0 5px var(--matrix-green); box-shadow: 0 0 5px var(--matrix-green) inset; opacity: 0.8; } }

@media (max-width: 992px) { .container { width: 95%; padding: 30px; } h1 { font-size: 2rem; } }
@media (max-width: 768px) {
    body { flex-direction: column; justify-content: flex-start; padding-top: 20px; height: auto; }
    .brand-logo { position: static; max-width: 150px; margin: 0 auto 15px auto; display: block; }
    .top-panel { position: static; width: 100%; padding: 0 15px 20px 15px; align-items: center; }
    .auth-buttons { width: 100%; justify-content: space-between; gap: 10px; margin: 0 0 15px 0; }
    .matrix-btn.small-btn { flex: 1; font-size: 0.8rem; padding: 10px 5px; white-space: nowrap; }
    .lang-switcher { width: 100%; justify-content: center; }
    .container { margin-top: 0; padding: 20px; margin-bottom: 80px; }
    h1 { font-size: 1.6rem; word-wrap: break-word; }
    .grid-menu { grid-template-columns: 1fr; gap: 15px; }
    #main-subtitle { max-width: 100%; }
    .content-box { flex-direction: column; gap: 20px; }
    .visual-representation { width: 100%; min-height: 150px; font-size: 4rem; }
    .text-content { text-align: left; }
    .actions { flex-direction: column-reverse; }
    .floating-ask-btn { width: 90%; right: 5%; left: 5%; bottom: 10px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid input:nth-last-child(1):nth-child(odd) { grid-column: span 1; }
    .modal { align-items: flex-start; padding-top: 20px; padding-bottom: 20px; }
    .modal-content { margin: 0 auto; width: 95%; }
    
    /* Адаптив для OTP на телефоне */
    .otp-container { gap: 5px; }
    .otp-input { width: 40px !important; height: 40px !important; font-size: 1.5rem; }
    .otp-buttons-row { flex-direction: column; gap: 10px; }
}

@media (max-width: 480px) {
    .container { width: calc(100% - 20px); padding: 16px; }
    h1 { font-size: clamp(1.2rem, 6vw, 1.5rem); letter-spacing: 1px; }
    #main-subtitle { font-size: 1rem; }
    .grid-menu { gap: 12px; }
    .grid-menu .matrix-btn { font-size: 1rem; padding: 13px 12px; }
}
