* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4fd8ff;
    --primary-2: #58c98a;
    --dark: #08131f;
    --light: #F8FAFC;
    --text: #15202b;
    --border: #d7e6f2;
    --success: #58c98a;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--light);
    color: var(--text);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    padding-top: var(--header-offset, 0px);
    transition: padding-top 0.28s ease;
}

body.modal-open {
    overflow: hidden;
}

body.auth-page {
    background: url('/assets/bg.jpg') no-repeat center center/cover;
}

/* ========== HEADER ========== */
header.header {
    background: rgba(8, 19, 31, 0.78);
    backdrop-filter: blur(18px);
    color: white;
    padding: 20px 0;
    box-shadow: 0 18px 40px rgba(8, 19, 31, 0.12);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    overflow: hidden;
    border-bottom: 1px solid rgba(207, 227, 239, 0.18);
}

header.header.nav-hidden nav.nav {
    max-height: 0;
    margin-top: 0;
    padding-top: 0;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: transparent;
    background: linear-gradient(135deg, #ffffff 0%, #8ae8ff 45%, #4fd8ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    letter-spacing: 2px;
}

.right-block {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart {
    color: white;
    text-decoration: none;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(207, 227, 239, 0.20);
    transition: all 0.25s ease;
}

.cart:hover {
    background: rgba(79, 216, 255, 0.16);
    color: white;
}

.username {
    color: #AAA;
    font-size: 14px;
}

.btn {
    padding: 10px 20px;
    border: 1px solid rgba(207, 227, 239, 0.18);
    border-radius: 999px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.25s ease;
    text-decoration: none;
    display: inline-block;
    background: rgba(255, 255, 255, 0.06);
    color: white;
}

.btn:hover {
    background: rgba(79, 216, 255, 0.14);
    border-color: rgba(79, 216, 255, 0.35);
}

.btn.small {
    padding: 8px 16px;
    font-size: 13px;
}

.btn.primary {
    background: linear-gradient(135deg, #4fd8ff, #58c98a);
    color: white;
    border-color: transparent;
    box-shadow: 0 12px 26px rgba(79, 216, 255, 0.18);
}

.btn.primary:hover {
    background: linear-gradient(135deg, #64e0ff, #69d39a);
    transform: translateY(-2px);
}

nav.nav {
    display: flex;
    justify-content: center;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px 0;
    overflow: hidden;
    max-height: 120px;
    transition: max-height 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease, transform 0.28s ease, padding-top 0.28s ease, margin-top 0.28s ease;
    will-change: max-height, opacity, transform;
}

nav.nav a {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    font-size: 15px;
    transition: color 0.25s ease;
    position: relative;
}

nav.nav a:hover {
    color: #ffffff;
}

nav.nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #4fd8ff, #58c98a);
    transition: width 0.25s ease;
}

nav.nav a:hover::after {
    width: 100%;
}

/* ========== MAIN ========== */
main {
    flex: 1;
}

/* ========== SLIDER ========== */
.slider {
    position: relative;
    overflow: hidden;
    background: var(--dark);
    height: 400px;
    margin-bottom: 40px;
}

.slides {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease;
}

.slide {
    min-width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
}

.slide-content {
    position: absolute;
    color: white;
    text-align: center;
    z-index: 10;
}

.slide-content h2 {
    font-size: 42px;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.slide-content p {
    font-size: 18px;
    margin-bottom: 20px;
    max-width: 500px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.slide-content span {
    display: inline-block;
    background: var(--primary);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 20px;
    font-weight: bold;
}

.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.3);
    color: white;
    border: none;
    font-size: 36px;
    padding: 10px 20px;
    cursor: pointer;
    z-index: 20;
    transition: background 0.3s;
    border-radius: 5px;
}

.prev:hover, .next:hover {
    background: rgba(255,255,255,0.6);
}

.prev {
    left: 20px;
}

.next {
    right: 20px;
}

/* ========== FEATURES ========== */
.features {
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.features h2 {
    text-align: center;
    font-size: 36px;
    margin-bottom: 40px;
    color: var(--dark);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s;
    border-top: 4px solid var(--primary);
}

.feature:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.feature .icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.feature h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--dark);
}

.feature p {
    color: #666;
    font-size: 14px;
}

/* ========== ABOUT ========== */
.about {
    background: white;
    padding: 60px 20px;
    margin-bottom: 60px;
}

.about-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    align-items: center;
}

.about-img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    max-height: 400px;
    object-fit: cover;
}

.about-text h2 {
    font-size: 36px;
    margin-bottom: 20px;
    color: var(--dark);
}

.about-text p {
    font-size: 16px;
    line-height: 1.8;
    color: #555;
}

/* ========== REVIEWS ========== */
.reviews {
    background: var(--light);
    padding: 60px 20px;
    margin-bottom: 60px;
}

.reviews h2 {
    text-align: center;
    font-size: 36px;
    margin-bottom: 40px;
    color: var(--dark);
}

.reviews-slider {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    overflow: hidden;
}

.reviews-track {
    display: flex;
    gap: 20px;
    transition: transform 0.5s ease;
}

.review-card {
    flex: 0 0 30%;
    min-width: 300px;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-left: 4px solid var(--primary);
}

.review-card p {
    font-size: 16px;
    margin-bottom: 15px;
    font-style: italic;
    color: #555;
}

.review-card span {
    display: block;
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

.rev-prev, .rev-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    border: none;
    font-size: 28px;
    padding: 10px 16px;
    cursor: pointer;
    z-index: 20;
    transition: background 0.3s;
    border-radius: 5px;
}

.rev-prev:hover, .rev-next:hover {
    background: #E55A2B;
}

.rev-prev {
    left: -50px;
}

.rev-next {
    right: -50px;
}

/* ========== CONTACTS ========== */
.contacts {
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.contacts h2 {
    text-align: center;
    font-size: 36px;
    margin-bottom: 40px;
    color: var(--dark);
}

.contact-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.contact-info p {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--text);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input,
.contact-form textarea {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255,107,53,0.1);
}

.contact-form textarea {
    resize: vertical;
    min-height: 100px;
}

/* ========== FOOTER ========== */
footer {
    background: var(--dark);
    color: white;
    padding: 40px 20px;
    margin-top: auto;
    width: 100%;
    box-sizing: border-box;
}

.footer-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

footer h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--primary);
}

footer p {
    color: #AAA;
    font-size: 14px;
    line-height: 1.8;
}

footer a {
    color: #AAA;
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: var(--primary);
}

/* ========== FORM PAGES (LOGIN/REGISTER) ========== */
body.auth-page {
    background: url('/assets/bg.jpg') no-repeat center center/cover;
    background-attachment: fixed;
}

body.auth-page header {
    width: 100%;
}

body.auth-page main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

body.auth-page main::before {
    content: "";
    position: absolute;
    top: 0;
    left: -20px;
    right: -20px;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 0;
}

.auth-container {
    background: rgba(26, 26, 26, 0.95);
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 107, 53, 0.2);
    position: relative;
    z-index: 1;
}

.auth-container h2 {
    font-size: 28px;
    margin-bottom: 30px;
    text-align: center;
    color: white;
}

.auth-container input,
.auth-container textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 107, 53, 0.3);
    border-radius: 6px;
    color: white;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.3s;
}

.auth-container input::placeholder,
.auth-container textarea::placeholder {
    color: #AAA;
}

.auth-container input:focus,
.auth-container textarea:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 12px rgba(255, 107, 53, 0.3);
}

.auth-container .btn {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: block;
    text-align: center;
    transition: all 0.3s;
}

.auth-container .btn.primary {
    background: var(--primary);
    color: white;
}

.auth-container .btn.primary:hover {
    background: #E55A2B;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

.auth-container .btn:not(.primary) {
    background: transparent;
    color: white;
    border: 1px solid #AAA;
}

.auth-container .btn:not(.primary):hover {
    background: rgba(255, 107, 53, 0.2);
    border-color: var(--primary);
    color: var(--primary);
}

.auth-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.auth-actions .btn {
    flex: 1;
    margin: 0;
}

.auth-text {
    margin-top: 25px;
    text-align: center;
    font-size: 13px;
    color: #AAA;
}

.auth-text a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-text a:hover {
    text-decoration: underline;
}

.error {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid #E74C3C;
    color: #FF6B5B;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 13px;
}

.auth-logo {
    text-align: center;
    font-size: 32px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 30px;
    letter-spacing: 2px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .header-row {
        flex-direction: column;
        gap: 15px;
    }

    nav.nav {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
        max-height: 320px;
    }

    .slider {
        height: 250px;
    }

    .slide-content h2 {
        font-size: 24px;
    }

    .about-wrapper {
        grid-template-columns: 1fr;
    }

    .contact-box {
        grid-template-columns: 1fr;
    }

    .review-card {
        flex: 0 0 100%;
    }
}

/* ========== AUTH MODAL ========== */
.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-modal[hidden] {
    display: none;
}

.auth-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 19, 31, 0.58);
    backdrop-filter: blur(10px);
}

.auth-modal__dialog {
    position: relative;
    width: min(480px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border-radius: 32px;
    padding: 28px;
    background:
        radial-gradient(circle at top left, rgba(79, 216, 255, 0.14), transparent 28%),
        radial-gradient(circle at bottom right, rgba(88, 201, 138, 0.14), transparent 26%),
        rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(110, 148, 176, 0.22);
    box-shadow: 0 30px 80px rgba(8, 19, 31, 0.28);
    text-align: center;
}

.auth-modal__close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(110, 148, 176, 0.20);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    color: var(--text);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.auth-modal__close:hover {
    transform: scale(1.04);
    border-color: rgba(79, 216, 255, 0.35);
    background: #ffffff;
}

.auth-modal__header {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 22px;
    text-align: center;
}

.auth-modal__kicker {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(79, 216, 255, 0.12);
    color: var(--dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.auth-modal__header h2 {
    margin: 0 0 10px;
    font-size: 34px;
    line-height: 1.02;
    color: var(--dark);
}

.auth-modal__header p {
    margin: 0;
    color: #5a6b7c;
    font-size: 16px;
}

.auth-modal__tabs {
    display: inline-flex;
    gap: 10px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(8, 19, 31, 0.04);
    border: 1px solid rgba(110, 148, 176, 0.16);
    margin-bottom: 18px;
    margin-left: auto;
    margin-right: auto;
    width: auto;
    max-width: 100%;
}

.auth-modal__tab {
    border: 0;
    background: transparent;
    color: #5a6b7c;
    border-radius: 999px;
    padding: 10px 18px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.auth-modal__tab.is-active {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(79, 216, 255, 0.16);
}

.auth-modal__message {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 18px;
    font-size: 14px;
}

.auth-modal__message.is-success {
    background: rgba(88, 201, 138, 0.12);
    border: 1px solid rgba(88, 201, 138, 0.24);
    color: #1f7d59;
}

.auth-modal__message.is-error {
    background: rgba(225, 83, 83, 0.10);
    border: 1px solid rgba(225, 83, 83, 0.22);
    color: #9d2f2f;
}

.auth-modal__panels {
    display: grid;
    justify-items: center;
}

.auth-modal__panel {
    display: none;
}

.auth-modal__panel.is-active {
    display: block;
}

.auth-modal__stack {
    display: grid;
    gap: 14px;
    width: 100%;
    margin: 0 auto;
}

.auth-modal__stack--login {
    max-width: 100%;
}

.auth-modal__stack--register {
    max-width: 100%;
}

.auth-modal__panel--login {
    width: min(320px, 100%);
    margin: 0;
}

.auth-modal__panel--register {
    width: min(360px, 100%);
    margin: 0;
}

.auth-modal__panel .form-group label {
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 4px;
    text-align: center;
}

.auth-modal__panel .form-group input {
    width: 100%;
    border: 1px solid rgba(110, 148, 176, 0.22);
    background: rgba(248, 250, 252, 0.96);
    color: var(--text);
    border-radius: 18px;
    padding: 14px 16px;
    font: inherit;
}

.auth-modal__panel .form-group input:focus {
    outline: none;
    border-color: rgba(79, 216, 255, 0.75);
    box-shadow: 0 0 0 4px rgba(79, 216, 255, 0.12);
    background: #ffffff;
}

.auth-modal__submit {
    margin-top: 18px;
    min-width: 0;
}

.auth-modal__panel--login .auth-modal__submit,
.auth-modal__panel--register .auth-modal__submit {
    width: 100%;
}

.auth-modal__hint {
    display: none;
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(225, 83, 83, 0.22);
    background: rgba(225, 83, 83, 0.10);
    color: #9d2f2f;
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

.auth-modal__hint.is-visible {
    display: block;
}

.auth-modal__panel--login .form-group input {
    border-radius: 16px;
}

.auth-modal__panel--register .form-group input {
    border-radius: 18px;
}

@media (max-width: 900px) {
    .auth-modal__dialog {
        padding: 24px;
        width: min(480px, 100%);
    }

    .auth-modal__stack {
        grid-template-columns: 1fr;
    }

    .auth-modal__panel--login,
    .auth-modal__panel--register,
    .auth-modal__stack--login,
    .auth-modal__stack--register {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .auth-modal {
        padding: 12px;
    }

    .auth-modal__dialog {
        border-radius: 24px;
        width: 100%;
    }

    .auth-modal__header h2 {
        font-size: 28px;
    }

    .auth-modal__tabs {
        width: auto;
        justify-content: center;
    }

    .auth-modal__tab {
        flex: 0 0 auto;
    }
}
