/* ===== index.css ===== */

@font-face {
    font-family: 'NK63';
    src: url('nk63.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-image: url('photo_01.jpg');
    --primary-green: #6f8f7a;
    --primary-dark: #5d7c67;
    --text-dark: #1A2A3A;
    --text-light: #2c3e50;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

body::before {
    display: none;
}

.hero {
    max-width: 1300px;
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    border-radius: 4rem;
    box-shadow: 0 25px 45px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 2rem;
    align-items: center;
    padding: 3rem 3rem 3rem 4rem;
    background-image: var(--hero-bg, none);
    background-size: cover;
    background-position: center;
    position: relative;
    z-index: 1;
}

.hero-grid::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    border-radius: 4rem;
    pointer-events: none;
    z-index: 0;
}

.hero-grid>* {
    position: relative;
    z-index: 1;
}

.hero-content {
    z-index: 2;
}

.hero-title {
    font-family: 'NK63', 'Times New Roman', serif !important;
    font-style: italic !important;
    font-weight: 700 !important;
    font-size: clamp(5.5rem, 9vw, 7.2rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.hero-title span {
    font-family: 'NK63', 'Times New Roman', serif !important;
    font-style: italic !important;
    font-weight: 700 !important;
    color: var(--text-dark);
}

.hero-sub {
    font-size: clamp(1.1rem, 3.5vw, 1.5rem);
    font-weight: 500;
    color: #2c3e4e;
    margin-bottom: 1.2rem;
    border-left: 4px solid #A5927E;
    padding-left: 1rem;
}

.description {
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-light);
    margin-bottom: 2rem;
    max-width: 90%;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

.nav-btn {
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: 60px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    text-decoration: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

.nav-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px -10px rgba(0, 0, 0, 0.1);
}

.nav-btn:active {
    transform: scale(0.96);
}

.btn-login {
    background: var(--primary-green);
    color: white;
}
.btn-login:hover {
    background: var(--primary-dark);
}

.btn-register {
    background: #eef2f5;
    color: var(--text-light);
}
.btn-register:hover {
    background: #e2e7ec;
}

.hero-image {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.image-wrapper {
    background: linear-gradient(145deg, #ffffff, #f8fafd);
    border-radius: 2.5rem;
    padding: 0.8rem;
    box-shadow: 0 25px 35px -15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.image-wrapper:hover {
    transform: scale(1.02);
}

.image-wrapper:active {
    transform: scale(0.98);
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 2rem;
    display: block;
    background: #fff;
}

.glass-tag {
    display: inline-block;
    background: rgba(255, 255, 240, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 40px;
    padding: 0.3rem 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #2c5a6e;
    margin-bottom: 1rem;
    letter-spacing: 0.3px;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 2rem;
    max-width: 440px;
    width: 90%;
    padding: 2rem 2rem 2.2rem;
    box-shadow: 0 30px 50px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideUp 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.8rem;
    cursor: pointer;
    color: #8e9eaf;
    transition: color 0.2s;
    line-height: 1;
    background: none;
    border: none;
    padding: 0.5rem;
}
.modal-close:hover {
    color: #1e2f3c;
}
.modal-close:active {
    transform: scale(0.9);
}

.modal h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--text-dark), #1E4A6F);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.modal-sub {
    color: #5f6f7e;
    margin-bottom: 1.8rem;
    font-size: 0.9rem;
}

.input-group {
    text-align: left;
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-light);
    font-size: 0.85rem;
}

.input-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #d4dee5;
    border-radius: 1.5rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.95rem;
    transition: 0.2s;
    background: #fefefe;
    -webkit-appearance: none;
    appearance: none;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(111, 143, 122, 0.2);
}

.login-btn-submit {
    width: 100%;
    background: var(--primary-green);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 2rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: 0.2s;
    touch-action: manipulation;
}

.login-btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.login-btn-submit:active {
    transform: scale(0.97);
}

.error-msg {
    color: #c24a4a;
    font-size: 0.75rem;
    margin-top: 0.5rem;
    text-align: center;
    min-height: 1.2rem;
}

.toggle-link {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #6c7a89;
}
.toggle-link a {
    color: #2c3e4f;
    cursor: pointer;
    text-decoration: underline;
}
.toggle-link a:hover {
    color: #1a2a3a;
}

.login-success {
    color: #27ae60;
    font-size: 0.85rem;
    margin-top: 8px;
    display: none;
}
.login-success.show {
    display: block;
}

.forgot-password-btn {
    display: block;
    text-align: right;
    color: #6c7a89;
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 4px;
    text-decoration: underline;
    background: none;
    border: none;
}
.forgot-password-btn:hover {
    color: #2c3e4f;
}

.recovery-fields {
    display: none;
    margin-top: 6px;
}
.recovery-fields.show {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content,
.hero-image {
    animation: fadeSlideUp 0.6s cubic-bezier(0.2, 0.9, 0.4, 1.1) forwards;
}
.hero-image {
    animation-delay: 0.1s;
}

.loading-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e3a3f;
    color: white;
    padding: 12px 24px;
    border-radius: 60px;
    font-weight: 500;
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background: rgba(30, 58, 63, 0.95);
    font-size: 0.9rem;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ===== МОБИЛЬНАЯ ОПТИМИЗАЦИЯ (СОХРАНЯЕМ ДЕСКТОПНЫЙ ВИД) ===== */

@media (max-width: 1024px) {
    body {
        padding: 1.5rem;
    }

    .hero-grid {
        gap: 1.5rem;
        padding: 2.5rem;
    }
}

@media (max-width: 900px) {
    body {
        padding: 1rem;
    }

    .hero {
        border-radius: 3rem;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        padding: 2rem;
        text-align: center;
        gap: 2rem;
    }

    .hero-grid::before {
        border-radius: 3rem;
    }

    .hero-title {
        font-size: clamp(4rem, 10vw, 5.5rem);
    }

    .hero-sub {
        border-left: none;
        padding-left: 0;
        text-align: center;
    }

    .description {
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }

    .button-group {
        justify-content: center;
    }

    .hero-image {
        order: -1;
    }

    .image-wrapper {
        max-width: 500px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    body {
        padding: 0.75rem;
        background-attachment: scroll;
    }

    .hero {
        border-radius: 2rem;
    }

    .hero-grid {
        padding: 1.5rem;
        gap: 1.5rem;
    }

    .hero-grid::before {
        border-radius: 2rem;
    }

    .hero-title {
        font-size: clamp(3rem, 12vw, 4rem);
    }

    .nav-btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
        min-height: 44px;
    }

    .image-wrapper {
        border-radius: 2rem;
        padding: 0.6rem;
    }

    .hero-image img {
        border-radius: 1.5rem;
    }

    .modal-content {
        padding: 1.75rem 1.5rem 2rem;
        width: 95%;
    }

    .modal-close {
        top: 0.75rem;
        right: 1.25rem;
        font-size: 1.6rem;
        padding: 0.4rem;
        min-width: 44px;
        min-height: 44px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.5rem;
    }

    .hero {
        border-radius: 1.5rem;
    }

    .hero-grid {
        padding: 1.25rem;
        gap: 1.25rem;
    }

    .hero-grid::before {
        border-radius: 1.5rem;
    }

    .hero-title {
        font-size: clamp(2.8rem, 14vw, 3.5rem);
        margin-bottom: 0.5rem;
    }

    .button-group {
        gap: 0.75rem;
        flex-direction: column;
        align-items: stretch;
    }

    .nav-btn {
        padding: 0.75rem 1.2rem;
        font-size: 0.9rem;
        min-height: 48px;
        justify-content: center;
        width: 100%;
    }

    .image-wrapper {
        border-radius: 1.5rem;
        padding: 0.5rem;
    }

    .hero-image img {
        border-radius: 1rem;
    }

    .modal-content {
        padding: 1.5rem 1.25rem 1.75rem;
        border-radius: 1.5rem;
        width: 98%;
    }

    .modal h2 {
        font-size: 1.5rem;
    }

    .modal-sub {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
    }

    .input-group {
        margin-bottom: 1rem;
    }

    .input-group input {
        padding: 0.7rem 0.9rem;
        font-size: 0.9rem;
        min-height: 44px;
    }

    .login-btn-submit {
        padding: 0.7rem;
        font-size: 0.95rem;
        min-height: 44px;
    }

    .loading-toast {
        padding: 10px 16px;
        font-size: 0.8rem;
        width: 92%;
        max-width: 350px;
    }
}

@media (max-width: 380px) {
    .hero-grid {
        padding: 1rem;
        gap: 1rem;
    }

    .hero-title {
        font-size: clamp(2.2rem, 16vw, 2.8rem);
    }

    .hero {
        border-radius: 1rem;
    }

    .hero-grid::before {
        border-radius: 1rem;
    }

    .nav-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        min-height: 40px;
    }

    .modal-content {
        padding: 1.25rem 1rem 1.5rem;
        border-radius: 1rem;
    }

    .modal-close {
        top: 0.5rem;
        right: 1rem;
        font-size: 1.4rem;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (orientation: landscape) and (max-height: 500px) {
    body {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 0.5rem;
    }

    .hero {
        border-radius: 1.5rem;
        max-height: 98vh;
    }

    .hero-grid {
        grid-template-columns: 1fr 1fr;
        padding: 1.25rem;
        gap: 1.5rem;
        align-items: center;
    }

    .hero-grid::before {
        border-radius: 1.5rem;
    }

    .hero-title {
        font-size: clamp(2rem, 6vh, 3rem);
        margin-bottom: 0.3rem;
    }

    .button-group {
        gap: 0.5rem;
        margin-top: 0.5rem;
        flex-direction: row;
    }

    .nav-btn {
        padding: 0.4rem 1rem;
        font-size: 0.75rem;
        min-height: 32px;
    }

    .hero-image img {
        max-height: 40vh;
        object-fit: cover;
    }

    .image-wrapper {
        padding: 0.4rem;
        border-radius: 1.5rem;
    }
}

/* Тёмная тема */
@media (prefers-color-scheme: dark) {
    .hero {
        background: rgba(30, 40, 50, 0.92);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .hero-grid::before {
        background: rgba(20, 30, 40, 0.85);
    }

    .hero-title {
        color: #e8edf2;
    }

    .hero-title span {
        color: #e8edf2;
    }

    .hero-sub {
        color: #b0c4d4;
    }

    .description {
        color: #b8c8d8;
    }

    .btn-register {
        background: #3a4a5a;
        color: #e8edf2;
    }
    .btn-register:hover {
        background: #4a5a6a;
    }

    .modal-content {
        background: #1e2a36;
    }

    .modal h2 {
        background: linear-gradient(135deg, #e8edf2, #8ab4d8);
        background-clip: text;
        -webkit-background-clip: text;
    }

    .modal-sub {
        color: #a0b4c4;
    }

    .input-group label {
        color: #c8d8e8;
    }

    .input-group input {
        background: #2a3a4a;
        border-color: #4a5a6a;
        color: #e8edf2;
    }

    .input-group input:focus {
        border-color: var(--primary-green);
    }

    .modal-close {
        color: #8a9aaa;
    }
    .modal-close:hover {
        color: #d0dce8;
    }
}

/* Учёт безопасных зон */
@supports (padding: max(0px)) {
    body {
        padding-left: max(2rem, env(safe-area-inset-left));
        padding-right: max(2rem, env(safe-area-inset-right));
        padding-top: max(2rem, env(safe-area-inset-top));
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }
}

/* Для пользователей с ограничением движений */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}