/* Medgyrus design system - shared across all pages */
:root {
    --navy: #0A192F;
    --dark-navy: #050C1A;
    --accent-cyan: #00D9FF;
    --accent-blue: #3B82F6;
    --accent-magenta: #EC4899;
    --soft-white: #F8FAFC;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--navy);
    color: var(--soft-white);
    overflow-x: hidden;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input,
textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.bg-animated {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(0, 217, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(236, 72, 153, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 60%),
        linear-gradient(180deg, var(--navy) 0%, var(--dark-navy) 100%);
}

.glass {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(0, 217, 255, 0.4);
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 217, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-gradient {
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    border: none;
    color: white;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 217, 255, 0.3);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn-gradient:hover::before {
    left: 100%;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 217, 255, 0.5);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid rgba(0, 217, 255, 0.4);
    color: var(--accent-cyan);
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-outline:hover {
    background: rgba(0, 217, 255, 0.1);
    border-color: var(--accent-cyan);
    transform: translateY(-2px);
    color: var(--accent-cyan);
}

.gradient-text {
    background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 50%, var(--accent-magenta) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-name {
    font-weight: 800;
}

.popular-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: linear-gradient(135deg, var(--accent-magenta), #F97316);
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
}

.promo-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--soft-white);
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    width: 100%;
}

.promo-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

.promo-input::placeholder {
    color: rgba(248, 250, 252, 0.4);
}

.desktop-nav {
    display: flex;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 12px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    z-index: 100;
    background: none;
    border: none;
}

.hamburger span {
    width: 24px;
    height: 3px;
    background: var(--accent-cyan);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 25, 47, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.mg-container {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.hero-title {
    font-size: clamp(1.75rem, 8vw, 3.75rem);
    line-height: 1.15;
}

@media (max-width: 768px) {
    .mobile-nav {
        display: flex;
    }
    .desktop-nav {
        display: none !important;
    }
    .hamburger {
        display: flex !important;
    }
    main {
        padding-bottom: 100px !important;
    }
    .mg-container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (min-width: 640px) {
    .mg-container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--soft-white);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 44px;
}

.nav-btn:hover {
    background: rgba(0, 217, 255, 0.1);
    border-color: rgba(0, 217, 255, 0.3);
    color: var(--soft-white);
}

.mobile-menu {
    position: fixed;
    top: 72px;
    right: -100%;
    width: 280px;
    max-width: 85vw;
    height: calc(100vh - 72px);
    background: rgba(10, 25, 47, 0.98);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px;
    transition: right 0.3s ease;
    z-index: 99;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 98;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu nav {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mobile-menu .btn-outline,
.mobile-menu .btn-gradient {
    width: 100%;
    text-align: center;
}

.nav-user-wrap {
    display: none;
    align-items: center;
    gap: 8px;
}

.nav-user-wrap.show {
    display: inline-flex !important;
}

.nav-user-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
}

.nav-auth-link {
    color: var(--soft-white);
    text-decoration: none;
    font-weight: 600;
}

.nav-auth-link:hover {
    color: var(--accent-cyan);
}

.icon-wrapper {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.15), rgba(59, 130, 246, 0.15));
    border-radius: 12px;
    border: 1px solid rgba(0, 217, 255, 0.3);
}

/* Content page helpers */
.back-wrap {
    margin-bottom: 0.75rem;
}

.back-link {
    color: var(--accent-cyan);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

.back-link.btn-outline {
    font-size: inherit;
}

.back-link.btn-outline:hover {
    text-decoration: none;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.content-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 1.5rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0;
}

.content-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(0, 217, 255, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(0, 217, 255, 0.15);
}

.content-card a {
    color: var(--soft-white);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.125rem;
    display: block;
}

.content-card a:hover {
    color: var(--accent-cyan);
}

.content-card-locked {
    opacity: 0.85;
    border-color: rgba(255, 255, 255, 0.08);
}

.content-card-locked:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

.content-card-locked a:hover {
    color: var(--soft-white);
}

.lock-icon {
    display: inline-block;
    margin-right: 0.35rem;
    font-size: 1rem;
    vertical-align: middle;
}

/* Answer mode toggle (Concise / In-Depth) */
.answer-mode-toggle {
    display: inline-flex;
    border-radius: 9999px;
    padding: 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    gap: 0;
}

.answer-mode-option {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    border: none;
    /* Subtle pill background for inactive Concise/In-Depth option */
    background: rgba(15, 23, 42, 0.85);
    color: rgba(248, 250, 252, 0.82);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease;
}

.answer-mode-option:hover {
    color: rgba(248, 250, 252, 0.95);
}

.answer-mode-option.active {
    /* Brighter cyan → purple gradient for active Concise/In-Depth option */
    background: linear-gradient(135deg, #06b6d4, #a855f7);
    color: white;
}

.answer-mode-icon {
    font-size: 1rem;
    line-height: 1;
}

/* Floating answer mode (Concise / In-Depth) at question type level */
.answer-mode-wrap.floating {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1100;
    margin-top: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    border-radius: 9999px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

@media (max-width: 768px) {
    .answer-mode-wrap.floating {
        bottom: 5.5rem;
    }
}

.page-message {
    text-align: center;
    padding: 2rem;
    color: rgba(248, 250, 252, 0.7);
    font-size: 1.125rem;
}

.page-message.loading {
    color: rgba(248, 250, 252, 0.5);
}

.page-message.error {
    color: #F97316;
}

.btn-retry {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: white;
    border: none;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9375rem;
    text-decoration: none;
}

.btn-retry:hover {
    opacity: 0.9;
    color: white;
}

/* Auth page helpers */
.auth-card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 1.5rem;
    width: 100%;
    max-width: 400px;
}

.auth-card h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.auth-card .form-group {
    margin-bottom: 1rem;
}

.auth-card .form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    color: rgba(248, 250, 252, 0.8);
}

.auth-card .form-group input {
    width: 100%;
    padding: 14px 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.05);
    color: var(--soft-white);
}

.auth-card .form-group input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

.auth-card .btn-primary {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
}

.auth-card .btn-primary:hover:not(:disabled) {
    opacity: 0.95;
}

.auth-card .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-links {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: rgba(248, 250, 252, 0.8);
}

.auth-links a {
    color: var(--accent-cyan);
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-error {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(249, 115, 22, 0.15);
    color: #F97316;
    border-radius: 12px;
    font-size: 0.875rem;
    display: none;
}

.auth-error.visible {
    display: block;
}

.auth-success {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(5, 166, 119, 0.15);
    color: #05A677;
    border-radius: 12px;
    font-size: 0.875rem;
    display: none;
}

.auth-success.visible {
    display: block;
}

@media (max-width: 640px) {
    .section-title {
        font-size: 1.75rem !important;
    }
    .brand-name {
        font-size: 1.25rem !important;
    }
}

@media (max-width: 375px) {
    .mg-container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}
