/* ===== IMPORT FONTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');

/* ===== CSS RESET & BASE STYLES ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand Colors */
    --navy: #1D2A3B;
    --teal: #00BFA5;
    --orange: #FF6B35;
    --soft-gray: #F5F5F7;
    --charcoal: #333333;
    --white: #FFFFFF;

    /* Additional Colors */
    --light-teal: rgba(0, 191, 165, 0.1);
    --light-navy: rgba(29, 42, 59, 0.05);
    --navy-80: rgba(29, 42, 59, 0.8);
    --divider: rgba(29, 42, 59, 0.15);
    --error: #FF3B5C;
    --success: #0ACF83;
    --warning: #FFCC00;

    /* Typography */
    --body-font: 'Poppins', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2.5rem;
    --spacing-xl: 4rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 50%;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Shadows */
    --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);
    --shadow-input: 0 2px 4px rgba(0, 0, 0, 0.04);
}

html {
    font-size: 62.5%;
    /* 10px base for easier rem calculation */
    scroll-behavior: smooth;
}

body {
    font-family: var(--body-font);
    font-size: 1.6rem;
    line-height: 1.6;
    color: var(--charcoal);
    background-color: var(--white);
    background-image:
        radial-gradient(circle at 90% 10%, rgba(0, 191, 165, 0.03) 0%, transparent 30%),
        radial-gradient(circle at 10% 90%, rgba(29, 42, 59, 0.03) 0%, transparent 30%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

a {
    text-decoration: none;
    color: var(--teal);
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--navy);
}

ul {
    list-style-position: inside;
    margin-bottom: var(--spacing-md);
}

li {
    margin-bottom: var(--spacing-xs);
}

/* Typography Styles */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--body-font);
    font-weight: 600;
    line-height: 1.3;
    color: var(--navy);
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: 3.6rem;
    font-weight: 700;
}

h2 {
    font-size: 2.4rem;
}

h3 {
    font-size: 2.2rem;
    margin-top: var(--spacing-md);
    color: var(--navy);
}

h4 {
    font-size: 1.8rem;
    margin-top: var(--spacing-sm);
}

p {
    margin-bottom: var(--spacing-md);
}

strong {
    font-weight: 600;
    color: var(--navy);
}

/* ===== HEADER STYLES ===== */
.main-header {
    background-color: var(--white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: var(--spacing-sm) 0;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    flex: 0 0 auto;
}

.logo {
    height: 5rem;
    width: auto;
    transition: transform var(--transition-fast);
}

.logo:hover {
    transform: scale(1.05);
}

/* ===== MAIN CONTENT STYLES ===== */
.main-content {
    flex: 1;
    padding: var(--spacing-xl) 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Welcome Section Styles */
.welcome-section {
    text-align: center;
    max-width: 800px;
    margin: 0 auto var(--spacing-xl);
    animation: fadeInDown 0.8s ease-out forwards;
}

.welcome-section h1 {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    background: linear-gradient(135deg, var(--navy), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.welcome-section h2 {
    font-size: 2.4rem;
    font-weight: 500;
    margin-bottom: var(--spacing-md);
    color: var(--navy-80);
}

.welcome-text {
    font-size: 1.8rem;
    line-height: 1.7;
    color: var(--navy-80);
}

/* Login Process Container Styles */
.login-process {
    width: 100%;
    max-width: 500px;
    margin: 0 auto var(--spacing-xl);
    position: relative;
    min-height: 400px;
}

.login-state {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
    transform: translateY(20px);
}

.login-state.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    position: relative;
    animation: fadeInUp 0.5s ease-out forwards;
}

/* Form Container Styles */
.form-container {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-lg);
    overflow: hidden;
    position: relative;
}

.form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--teal), var(--navy));
}

.form-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.form-header h3 {
    margin-top: 0;
    margin-bottom: var(--spacing-sm);
    font-size: 2.4rem;
}

.form-header p {
    color: var(--navy-80);
    margin-bottom: var(--spacing-xs);
}

.hint-text {
    font-size: 1.4rem;
    color: var(--navy-80);
    font-style: italic;
}

/* Form Styles */
.form-group {
    margin-bottom: var(--spacing-md);
}

label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--navy);
}

input[type="email"],
input[type="text"] {
    width: 100%;
    padding: 1.5rem;
    border: 2px solid var(--light-navy);
    border-radius: var(--radius-md);
    font-family: var(--body-font);
    font-size: 1.6rem;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-input);
}

input[type="email"]:focus,
input[type="text"]:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.2);
    outline: none;
}

.error-message {
    color: var(--error);
    font-size: 1.4rem;
    margin-top: var(--spacing-xs);
    height: 20px;
    transition: all var(--transition-normal);
}

.form-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: var(--spacing-lg);
}

/* Button Styles */
.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.4rem 2.8rem;
    background-color: var(--teal);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--body-font);
    font-size: 1.6rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    min-width: 200px;
    box-shadow: 0 3px 10px rgba(0, 191, 165, 0.3);
    position: relative;
}

.primary-button:hover {
    background-color: #00A890;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 191, 165, 0.4);
}

.primary-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 191, 165, 0.4);
}

.text-button {
    background: none;
    border: none;
    color: var(--teal);
    font-family: var(--body-font);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color var(--transition-fast);
    padding: var(--spacing-xs) var(--spacing-sm);
}

.text-button:hover {
    color: var(--navy);
    text-decoration: underline;
}

.text-button:disabled {
    color: var(--light-navy);
    cursor: not-allowed;
    text-decoration: none;
}

.secondary-actions {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: var(--spacing-md);
}

/* Button Loader Styles */
.button-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    margin-left: var(--spacing-xs);
    animation: spin 0.8s linear infinite;
}

.primary-button.loading .button-text {
    visibility: hidden;
    opacity: 0;
}

.primary-button.loading .button-loader {
    display: block;
    position: absolute;
}

/* Verification Screen Styles */
.success-icon {
    width: 60px;
    height: 60px;
    background-color: var(--success);
    border-radius: 50%;
    margin: 0 auto var(--spacing-md);
    position: relative;
}

.success-icon::before,
.success-icon::after {
    content: '';
    position: absolute;
    background-color: var(--white);
}

.success-icon::before {
    width: 30px;
    height: 3px;
    transform: rotate(45deg);
    top: 30px;
    left: 17px;
}

.success-icon::after {
    width: 15px;
    height: 3px;
    transform: rotate(-45deg);
    top: 27px;
    left: 13px;
}

#user-email {
    font-weight: 600;
    color: var(--navy);
}

.code-input-container {
    position: relative;
}

.expiry-timer {
    text-align: right;
    font-size: 1.4rem;
    color: var(--navy-80);
    margin-top: var(--spacing-xs);
}

/* Loading State Styles */
.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    text-align: center;
}

.spinner {
    width: 70px;
    height: 70px;
    border: 4px solid rgba(0, 191, 165, 0.1);
    border-radius: 50%;
    border-left-color: var(--teal);
    animation: spin 1s linear infinite;
    margin-bottom: var(--spacing-md);
}

#loading-message {
    font-size: 1.8rem;
    color: var(--navy);
}

/* Error State Styles */
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-lg);
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.error-icon {
    width: 70px;
    height: 70px;
    background-color: var(--error);
    border-radius: 50%;
    margin-bottom: var(--spacing-md);
    position: relative;
}

.error-icon::before,
.error-icon::after {
    content: '';
    position: absolute;
    width: 35px;
    height: 4px;
    background-color: var(--white);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.error-icon::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.error-icon::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

#error-message {
    margin-bottom: var(--spacing-lg);
}

/* Security Info Section Styles */
.security-info {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    background-color: var(--light-navy);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    animation: fadeIn 1s ease-out 0.5s forwards;
    opacity: 0;
}

.security-info h3 {
    margin-top: 0;
    margin-bottom: var(--spacing-md);
    color: var(--navy);
    position: relative;
    display: inline-block;
}

.security-info h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: var(--teal);
    border-radius: 2px;
}

.security-features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

.security-feature {
    flex: 1 1 250px;
    max-width: 300px;
    display: flex;
    align-items: flex-start;
    text-align: left;
}

.feature-icon {
    width: 50px;
    height: 50px;
    background-color: var(--light-teal);
    border-radius: var(--radius-full);
    margin-right: var(--spacing-md);
    flex-shrink: 0;
    position: relative;
}

.encryption-icon::before {
    content: '\f023';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--teal);
    font-size: 2.2rem;
}

.session-icon::before {
    content: '\f017';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--teal);
    font-size: 2.2rem;
}

.verification-icon::before {
    content: '\f058';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--teal);
    font-size: 2.2rem;
}

.feature-text h4 {
    font-size: 1.7rem;
    margin-top: 0;
    margin-bottom: var(--spacing-xs);
}

.feature-text p {
    font-size: 1.5rem;
    color: var(--navy-80);
    margin: 0;
}

/* ===== FOOTER STYLES ===== */
.site-footer {
    background-color: var(--navy);
    color: var(--white);
    padding: var(--spacing-lg) 0 var(--spacing-md);
    margin-top: auto;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.mode-toggle {
    flex: 0 0 auto;
}

.dark-mode-button {
    background: none;
    border: none;
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.1);
    transition: background-color var(--transition-fast);
}

.dark-mode-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.dark-mode-icon {
    position: relative;
    width: 24px;
    height: 24px;
}

.dark-mode-icon::before {
    content: '\f186';
    /* moon icon */
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--white);
    font-size: 1.8rem;
}

.social-links {
    flex: 0 0 auto;
}

.social-links h4 {
    color: var(--white);
    margin-bottom: var(--spacing-sm);
    text-align: right;
}

.social-icons {
    display: flex;
    gap: var(--spacing-sm);
    list-style: none;
    margin-bottom: 0;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--white);
    transition: all var(--transition-normal);
}

.social-icons a:hover {
    background-color: var(--teal);
    transform: translateY(-3px);
}

.footer-middle {
    margin-bottom: var(--spacing-lg);
}

.footer-nav {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
}

.footer-column {
    flex: 1 1 200px;
}

.footer-column h4 {
    color: var(--white);
    margin-bottom: var(--spacing-md);
    position: relative;
    display: inline-block;
    padding-bottom: var(--spacing-xs);
}

.footer-column h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--teal);
}

.footer-column ul {
    list-style: none;
    margin-bottom: 0;
}

.footer-column ul li {
    margin-bottom: var(--spacing-sm);
}

.footer-column ul li a {
    color: rgba(255, 255, 255, 0.8);
    transition: all var(--transition-normal);
    position: relative;
    display: inline-block;
}

.footer-column ul li a:hover {
    color: var(--teal);
    transform: translateX(5px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--spacing-md);
    text-align: center;
}

.copyright {
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.4rem;
    margin-bottom: 0;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Ripple effect for buttons */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* ===== DARK MODE STYLES ===== */
.dark-mode {
    --navy: #2A3F58;
    --teal: #00E6C3;
    --soft-gray: #2C2C34;
    --charcoal: #E6E6E6;
    --white: #1A1A1F;
    --light-teal: rgba(0, 230, 195, 0.1);
    --light-navy: rgba(42, 63, 88, 0.2);
    --navy-80: rgba(255, 255, 255, 0.8);
    --divider: rgba(255, 255, 255, 0.15);
}

.dark-mode .main-header {
    background-color: #14141A;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.dark-mode .form-container {
    background-color: #222228;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

.dark-mode .site-footer {
    background-color: #14141A;
}

.dark-mode .security-info {
    background-color: rgba(42, 63, 88, 0.1);
}

.dark-mode input[type="email"],
.dark-mode input[type="text"] {
    background-color: #2C2C34;
    border-color: #3C3C44;
    color: var(--charcoal);
}

.dark-mode input[type="email"]:focus,
.dark-mode input[type="text"]:focus {
    border-color: var(--teal);
}

.dark-mode .primary-button {
    background-color: var(--teal);
}

.dark-mode .primary-button:hover {
    background-color: #00D1B0;
}

.dark-mode .feature-icon {
    background-color: rgba(0, 230, 195, 0.1);
}

.dark-mode .error-container {
    background-color: #222228;
}

.dark-mode .welcome-section h1 {
    background: linear-gradient(135deg, #E6E6E6, var(--teal));
    -webkit-background-clip: text;
    background-clip: text;
}

.dark-mode .dark-mode-icon::before {
    content: '\f185';
    /* sun icon */
}

/* ===== RESPONSIVE STYLES ===== */
@media (max-width: 992px) {
    html {
        font-size: 58%;
    }

    .footer-top {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .social-links h4 {
        text-align: center;
    }

    .social-icons {
        justify-content: center;
    }

    .security-features {
        gap: var(--spacing-md);
    }
}

@media (max-width: 768px) {
    html {
        font-size: 55%;
    }

    .welcome-section h1 {
        font-size: 3.4rem;
    }

    .welcome-section h2 {
        font-size: 2.2rem;
    }

    .welcome-text {
        font-size: 1.6rem;
    }

    .form-container {
        padding: var(--spacing-md);
    }

    .security-feature {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .footer-nav {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .footer-column {
        text-align: center;
    }

    .footer-column h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .secondary-actions {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }
}

@media (max-width: 576px) {
    html {
        font-size: 50%;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    .welcome-section h1 {
        font-size: 3rem;
    }

    .welcome-section h2 {
        font-size: 2rem;
    }

    .form-container {
        border-radius: var(--radius-md);
    }

    .primary-button {
        width: 100%;
    }

    .login-process {
        min-height: 350px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {

    .main-header,
    .site-footer {
        display: none;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }

    .container {
        width: 100%;
        max-width: none;
        padding: 0;
        margin: 0;
    }
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */
:focus {
    outline: 3px solid var(--teal);
    outline-offset: 2px;
}

.skip-to-content {
    position: absolute;
    top: -9999px;
    left: -9999px;
    background: var(--teal);
    color: var(--white);
    padding: 1rem 1.5rem;
    z-index: 9999;
    opacity: 0;
}

.skip-to-content:focus {
    top: 0;
    left: 0;
    opacity: 1;
}

/* Improved text selection colors */
::selection {
    background-color: var(--teal);
    color: var(--white);
}