/* ===================================================================
   STYLES.CSS - Global App Styles (Premium Edition v2.0)
   Assessment flow styling with advanced effects
   =================================================================== */

/* ======== Global Base ======== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background: var(--bg-body);
    background-image:
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.12) 0px, transparent 50%),
        radial-gradient(at 98% 2%, rgba(139, 92, 246, 0.12) 0px, transparent 45%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.06) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(6, 182, 212, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-main);
    line-height: 1.6;
    padding: var(--space-6);
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ======== Layout Containers ======== */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-4);
    position: relative;
    z-index: 10;
}

/* ======== Header (Premium Floating Glass) ======== */
header {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-2xl);
    padding: var(--space-6) var(--space-8);
    margin-bottom: var(--space-12);
    box-shadow:
        var(--shadow-lg),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(0, 0, 0, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.4s var(--ease-silk);
    position: relative;
    overflow: hidden;
}

/* Animated border gradient */
header::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg,
            rgba(59, 130, 246, 0.3),
            rgba(139, 92, 246, 0.2),
            rgba(236, 72, 153, 0.1),
            rgba(59, 130, 246, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    background-size: 300% 300%;
    animation: gradientShift 8s ease infinite;
    opacity: 0;
    transition: opacity 0.4s ease;
}

header:hover::before {
    opacity: 1;
}

header:hover {
    box-shadow:
        var(--shadow-xl),
        0 0 40px rgba(59, 130, 246, 0.1);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.header-logo {
    height: 60px;
    width: auto;
    filter: drop-shadow(0 4px 6px rgba(59, 130, 246, 0.2));
    transition: all 0.4s var(--ease-spring);
}

.header-logo:hover {
    transform: scale(1.08) rotate(3deg);
    filter: drop-shadow(0 8px 16px rgba(59, 130, 246, 0.3));
}

.header-text h1 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #1e3a5f 0%, #3b82f6 50%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.01em;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(59, 130, 246, 0.1);
    position: relative;
}

.subtitle {
    color: var(--text-muted);
    font-size: var(--text-base);
    font-weight: 500;
    margin-top: var(--space-1);
    opacity: 0.9;
}

/* ======== Buttons (Premium Design) ======== */
button,
.btn-primary,
.btn-secondary,
.btn-success {
    font-family: var(--font-display);
    font-weight: 600;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all 0.3s var(--ease-spring);
    font-size: var(--text-base);
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Button Ripple Effect */
button::after,
.btn-primary::after,
.btn-secondary::after,
.btn-success::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.3) 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10);
    opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
}

button:active::after,
.btn-primary:active::after,
.btn-secondary:active::after,
.btn-success:active::after {
    transform: scale(0);
    opacity: 1;
    transition: 0s;
}

/* Primary Button */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow:
        var(--shadow-md),
        0 4px 15px -3px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow:
        var(--shadow-xl),
        0 10px 30px -5px rgba(59, 130, 246, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px);
}

/* Secondary Button */
.btn-secondary {
    background: white;
    color: var(--text-main);
    border: 1.5px solid var(--surface-200);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    border-color: var(--primary-light);
    color: var(--primary);
    background: var(--surface-50);
    box-shadow: var(--shadow-md), 0 0 20px rgba(59, 130, 246, 0.08);
    transform: translateY(-2px);
}

/* Success Button */
.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    box-shadow:
        var(--shadow-md),
        0 4px 15px -3px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    box-shadow:
        var(--shadow-xl),
        0 10px 30px -5px rgba(16, 185, 129, 0.5);
    transform: translateY(-3px);
}

/* Submit Button - Extra styling */
.btn-submit {
    width: 100%;
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-lg);
    border-radius: var(--radius-xl);
    position: relative;
}

.btn-submit svg {
    transition: transform 0.3s var(--ease-spring);
}

.btn-submit:hover svg {
    transform: translateX(4px);
}

/* Full Width Helper */
.full-width {
    width: 100%;
}

/* ======== Cards (Premium Glass) ======== */
.card {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    box-shadow:
        var(--shadow-lg),
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        inset 0 -1px 0 rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin-bottom: var(--space-8);
    position: relative;
    transition: all 0.4s var(--ease-silk);
}

.card:hover {
    box-shadow:
        var(--shadow-xl),
        0 0 40px rgba(59, 130, 246, 0.08);
    transform: translateY(-2px);
}

/* Question Card specific */
.question-card {
    padding: var(--space-10);
}

/* Login Card Premium */
.premium-login-card {
    max-width: 420px;
    margin: 0 auto;
    padding: var(--space-10);
    text-align: center;
}

.login-header {
    margin-bottom: var(--space-8);
}

.login-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-4);
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 25px -5px rgba(59, 130, 246, 0.4);
    animation: floatSoft 6s ease-in-out infinite;
}

.premium-login-card h2 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    margin: 0 0 var(--space-2);
    color: var(--text-main);
}

.login-subtitle {
    color: var(--text-muted);
    margin: 0;
}

.help-text {
    margin-top: var(--space-6);
    font-size: var(--text-sm);
    color: var(--text-subtle);
}

/* ======== Forms & Inputs (Premium) ======== */
.input-group {
    margin-bottom: var(--space-6);
    position: relative;
}

.input-icon {
    position: absolute;
    left: 4px;
    top: 4px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: linear-gradient(135deg, var(--surface-50) 0%, var(--surface-100) 100%);
    border-radius: var(--radius-md);
    z-index: 2;
    transition: all 0.3s ease;
}

.input-wrapper {
    position: relative;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 16px 16px 16px 64px;
    background: white;
    border: 2px solid var(--surface-200);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    font-family: var(--font-body);
    color: var(--text-main);
    transition: all 0.3s var(--ease-out);
    box-shadow: var(--shadow-xs);
    box-sizing: border-box;
}

input:hover,
textarea:hover,
select:hover {
    border-color: var(--surface-300);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow:
        0 0 0 4px var(--primary-glow-soft),
        var(--shadow-sm);
    background: white;
}

input:focus~.input-icon,
textarea:focus~.input-icon {
    color: var(--primary-dark);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
}

label {
    position: absolute;
    left: 64px;
    top: 18px;
    color: var(--text-muted);
    font-size: var(--text-base);
    pointer-events: none;
    transition: all 0.25s var(--ease-out);
    background: transparent;
}

/* Floating Label Logic */
input:focus~label,
input:not(:placeholder-shown)~label,
input:valid~label {
    top: -10px;
    left: 56px;
    font-size: var(--text-xs);
    color: var(--primary);
    background: white;
    padding: 0 6px;
    font-weight: 600;
    border-radius: var(--radius-xs);
}

/* Premium Form Styling */
.premium-form {
    max-width: 500px;
    margin: 0 auto;
}

.form-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    color: var(--text-main);
    margin-bottom: var(--space-2);
    text-align: center;
}

.form-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: var(--space-8);
}

.login-form {
    text-align: left;
}

/* Filter Select */
.filter-select {
    padding: 10px 16px;
    background: white;
    border: 1.5px solid var(--surface-200);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 150px;
}

.filter-select:hover {
    border-color: var(--primary-light);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow-soft);
}

/* Input helper text */
.input-helper {
    display: block;
    margin-top: 6px;
    font-size: var(--text-xs);
    color: var(--text-subtle);
    padding-left: 64px;
}

/* ======== Assessment Flow Styles ======== */
.page {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.page.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: slideUpFade 0.6s var(--ease-silk);
}

/* Progress Bar (Premium) */
.progress-container {
    margin-bottom: var(--space-8);
}

.progress-bar {
    height: 10px;
    background: var(--surface-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-2);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg,
            var(--primary) 0%,
            var(--accent) 50%,
            var(--secondary) 100%);
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.6s var(--ease-spring);
    border-radius: var(--radius-full);
    position: relative;
    animation: gradientShift 3s ease infinite;
}

/* Animated glow on progress */
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.4),
            transparent);
    animation: shimmer 2s infinite;
}

.progress-text {
    text-align: right;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Question Text */
.question-text {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: var(--space-8);
    line-height: 1.5;
}

/* Option Cards (Premium) */
.options-grid {
    display: grid;
    gap: var(--space-4);
}

.answer-option {
    background: white;
    border: 2px solid var(--surface-200);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-6);
    cursor: pointer;
    transition: all 0.25s var(--ease-out);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    font-weight: 500;
    color: var(--text-main);
    overflow: hidden;
    position: relative;
}

/* Subtle hover animation */
.answer-option::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 100%);
    transform: scaleY(0);
    transition: transform 0.3s var(--ease-out);
    border-radius: 0 2px 2px 0;
}

.answer-option:hover {
    border-color: var(--primary-light);
    background: linear-gradient(135deg, var(--surface-50) 0%, rgba(59, 130, 246, 0.03) 100%);
    box-shadow: var(--shadow-md);
}

.answer-option:hover::before {
    transform: scaleY(1);
}

.answer-option.selected {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.05) 100%);
    box-shadow:
        0 0 0 3px var(--primary-glow-soft),
        var(--shadow-md);
}

.answer-option.selected::before {
    transform: scaleY(1);
}

.radio-indicator {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--surface-300);
    position: relative;
    flex-shrink: 0;
    transition: all 0.25s var(--ease-out);
}

.radio-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.25s var(--ease-spring);
}

.answer-option.selected .radio-indicator {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow-soft);
}

.answer-option.selected .radio-indicator::after {
    transform: translate(-50%, -50%) scale(1);
}

/* Navigation Buttons */
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    margin-top: var(--space-8);
}

/* ======== Results Page (Premium) ======== */
.results-header {
    text-align: center;
    background: white;
    border-radius: var(--radius-2xl);
    padding: var(--space-10);
    margin-bottom: var(--space-8);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

/* Celebration animation background */
.results-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--success), var(--secondary));
    background-size: 300% 100%;
    animation: gradientShift 3s ease infinite;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-6);
    margin: var(--space-8) 0;
}

/* ======== Footer (Premium) ======== */
.site-footer {
    text-align: center;
    margin-top: var(--space-16);
    padding: var(--space-8) 0;
    color: var(--text-subtle);
    font-size: var(--text-sm);
    position: relative;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
}

.footer-logo {
    height: 65px;
    opacity: 0.9;
    transition: all 0.4s var(--ease-out);
}

.footer-logo:hover {
    opacity: 1;
    transform: scale(1.05);
}

.footer-text {
    margin: 0;
    font-weight: 500;
    color: var(--text-muted);
}

/* ======== Dashboard Layout ======== */
.dashboard-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.dashboard-header-row h2 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ======== Info Cards (optional, for welcome page) ======== */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-8);
}

.info-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
    border: 1px solid var(--surface-100);
    transition: all 0.3s var(--ease-out);
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.info-card .icon {
    font-size: 2rem;
    display: block;
    margin-bottom: var(--space-3);
}

.info-card h3 {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    margin: 0 0 var(--space-2);
    color: var(--text-main);
}

.info-card p {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* ======== Responsive Design ======== */
@media (max-width: 768px) {
    body {
        padding: var(--space-4);
    }

    header {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
        padding: var(--space-6);
        border-radius: var(--radius-xl);
    }

    .header-brand {
        flex-direction: column;
    }

    .card {
        padding: var(--space-6);
        border-radius: var(--radius-xl);
    }

    .question-card {
        padding: var(--space-6);
    }

    .premium-login-card {
        padding: var(--space-6);
    }

    .navigation-buttons {
        flex-direction: column;
    }

    .navigation-buttons button {
        width: 100%;
    }

    .dashboard-header-row {
        flex-direction: column;
        text-align: center;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    textarea,
    select {
        padding-left: 56px;
    }

    .input-icon {
        width: 40px;
        height: 40px;
    }

    label {
        left: 56px;
    }

    input:focus~label,
    input:not(:placeholder-shown)~label {
        left: 48px;
    }
}

@media (max-width: 480px) {
    .progress-text {
        text-align: center;
    }

    .question-text {
        font-size: var(--text-lg);
    }

    .answer-option {
        padding: var(--space-3) var(--space-4);
    }
}

/* ===================================================================
   ANSWER OPTIONS - Fixed Styling (Override Global Label)
   =================================================================== */

/* Container for answer options */
.answer-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* Question content container */
.question-content {
    padding: var(--space-2) 0;
}

.question-content h3 {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 var(--space-4);
}

.question-content>p {
    font-family: var(--font-display);
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.5;
    margin: 0 0 var(--space-6);
}

/* CRITICAL: Override global label positioning inside answer options */
.answer-option label {
    position: static !important;
    left: auto !important;
    top: auto !important;
    color: var(--text-main);
    font-size: var(--text-base);
    font-weight: 500;
    pointer-events: none;
    background: transparent !important;
    padding: 0 !important;
    margin: 0;
    display: inline;
    cursor: pointer;
    transition: color 0.2s ease;
}

/* Hide the actual radio button */
.answer-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
}

/* Custom radio indicator */
.answer-option::after {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--surface-300);
    flex-shrink: 0;
    margin-left: auto;
    transition: all 0.25s var(--ease-out);
    position: relative;
}

.answer-option:hover::after {
    border-color: var(--primary-light);
}

.answer-option.selected::after {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: inset 0 0 0 3px white;
}

.answer-option.selected label {
    color: var(--primary-dark);
    font-weight: 600;
}

/* ======== Button Loading State ======== */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spin-icon {
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

button:disabled {
    pointer-events: none;
}

/* Mobile adjustments for global styles */
@media (max-width: 480px) {
    .premium-login-card {
        padding: var(--space-6) !important;
        max-width: 100%;
    }

    .input-icon {
        width: 44px !important;
        height: 44px !important;
    }

    .premium-login-card input[type="text"],
    .premium-login-card input[type="email"],
    .premium-login-card input[type="tel"],
    .premium-login-card input[type="password"],
    .premium-login-card textarea,
    .premium-login-card select {
        padding-left: 52px !important;
    }

    .premium-login-card label {
        left: 52px !important;
    }

    .premium-login-card input:focus~label,
    .premium-login-card input:not(:placeholder-shown)~label,
    .premium-login-card input:valid~label {
        left: 44px !important;
    }
}