/* ========================================================================
   MINIMALIST LOGIN PAGE STYLES
   Google/Apple-inspired clean design for Concloud authentication pages
   ======================================================================== */

/* ===== BASE STYLES ===== */
.login-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 1.5rem 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #050b3d;
    box-sizing: border-box;
}

/* ===== GRADIENT MESH BACKGROUND ===== */
.login-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        /* Accent from top-left - visible but not dominant */
        radial-gradient(ellipse 130% 130% at -20% -20%,
            rgba(16, 160, 218, 0.43) 0%,
            rgba(16, 160, 218, 0.27) 30%,
            transparent 55%),
        /* Accent from bottom-right */
        radial-gradient(ellipse 130% 130% at 120% 120%,
            rgba(42, 140, 247, 0.37) 0%,
            rgba(42, 140, 247, 0.23) 30%,
            transparent 55%),
        /* Small accent from top-right */
        radial-gradient(ellipse 80% 80% at 100% 0%,
            rgba(0, 212, 255, 0.30) 0%,
            transparent 45%),
        /* Base - business primary */
        #050b3d;
    z-index: -1;
    overflow: hidden;
}

/* Soft animated layer */
.login-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse 100% 100% at 30% 70%,
        rgba(16, 160, 218, 0.27) 0%,
        transparent 45%);
    filter: blur(40px);
    animation: meshFloat 50s ease-in-out infinite;
}

/* Second animated layer */
.login-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse 70% 70% at 70% 30%,
        rgba(0, 212, 255, 0.23) 0%,
        transparent 40%);
    filter: blur(30px);
    animation: meshFloat 45s ease-in-out infinite reverse;
}

/* Not used but kept for HTML compatibility */
.login-background-glow {
    display: none;
}

/* Gentle floating animation */
@keyframes meshFloat {
    0%, 100% {
        transform: translate(0%, 0%);
    }
    50% {
        transform: translate(2%, 2%);
    }
}


/* ===== CONTAINER ===== */
.login-container {
    width: 100%;
    max-width: 440px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===== CARD ===== */
.login-card {
    width: 100%;
    background: #ffffff;
    border-radius: 16px;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.04),
        0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 2.5rem;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    overflow: hidden;
}

.login-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== BRANDING ===== */
.login-branding {
    text-align: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.login-logo {
    height: 112px;
    width: auto;
    margin-bottom: 0.25rem;
    /* Recolor white PNG to business primary (#060d47 - dark blue) */
    filter: brightness(0) saturate(100%) invert(5%) sepia(50%) saturate(4000%) hue-rotate(220deg) brightness(85%) contrast(115%);
}

.login-tagline {
    display: block;
    font-size: 0.8125rem;
    color: #6b7280;
    font-weight: 400;
}

/* ===== CONTENT AREA ===== */
.login-content {
    width: 100%;
}

/* ===== FORM HEADER ===== */
/* Supports both .form-header and .login-header from child templates */
.form-header,
.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.form-title,
.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.form-subtitle,
.login-subtitle {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* ===== FORM INPUTS ===== */
.modern-login-form {
    width: 100%;
}

.form-group {
    margin-bottom: 1.25rem;
}

.input-wrapper {
    position: relative;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper:hover {
    border-color: #9ca3af;
}

.input-wrapper.focused {
    border-color: var(--business-primary, #060d47);
    box-shadow: 0 0 0 3px rgba(6, 13, 71, 0.08);
}

.modern-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: transparent;
    color: #111827;
    outline: none;
    box-sizing: border-box;
}

.modern-input::placeholder {
    color: #9ca3af;
}

/* Label positioned outside (floating above) */
.modern-label {
    position: absolute;
    left: 0.75rem;
    top: -0.625rem;
    background: #ffffff;
    padding: 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    pointer-events: none;
    transition: color 0.2s ease;
}

.input-wrapper.focused .modern-label {
    color: var(--business-primary, #060d47);
}

.modern-label i {
    font-size: 0.875rem;
}

/* Hide the decorative input-border element */
.input-border {
    display: none;
}

/* ===== PASSWORD TOGGLE ===== */
.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: color 0.2s ease, background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: #6b7280;
    background-color: #f3f4f6;
}

.password-toggle i {
    font-size: 1rem;
}

/* ===== BUTTON ===== */
.modern-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: var(--business-primary, #060d47);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease, transform 0.1s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.modern-btn:hover {
    background: var(--primary-light, #0f4eb4);
}

.modern-btn:active {
    transform: scale(0.99);
}

.modern-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(6, 13, 71, 0.2);
}

/* Loading State */
.modern-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.modern-btn.loading .btn-text {
    opacity: 0;
}

.modern-btn.loading .btn-loader {
    display: flex;
}

.btn-loader {
    position: absolute;
    display: none;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Hide decorative elements */
.btn-shine,
.btn-icon {
    display: none;
}

/* ===== MESSAGES ===== */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 0.875rem 1rem;
    margin-bottom: 1.25rem;
}

.error-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: #dc2626;
    font-size: 0.875rem;
    line-height: 1.4;
}

.error-item i {
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.success-message,
.message-container.success-message {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 0.875rem 1rem;
    margin-bottom: 1.25rem;
}

.success-message .message-item,
.message-container .message-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #16a34a;
    font-size: 0.875rem;
}

.message-container.error-message .message-item {
    color: #dc2626;
}

/* ===== LINKS & FOOTER ===== */
.form-options {
    text-align: center;
    margin-bottom: 1.25rem;
}

.simple-link,
.forgot-password,
.footer-link {
    color: var(--business-primary, #060d47);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.simple-link:hover,
.forgot-password:hover,
.footer-link:hover {
    color: var(--primary-light, #0f4eb4);
    text-decoration: underline;
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.footer-text {
    font-size: 0.8125rem;
    color: #6b7280;
    margin: 0;
}

/* Page-level footer */
.login-page-footer {
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ===== VALIDATION STATES ===== */
.input-wrapper.error {
    border-color: #ef4444;
}

.input-wrapper.error .modern-label {
    color: #ef4444;
}

.input-wrapper.success {
    border-color: #22c55e;
}

.input-wrapper.success .modern-label {
    color: #22c55e;
}

.input-wrapper.warning {
    border-color: #f59e0b;
}

/* Shake animation for errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.input-wrapper.shake {
    animation: shake 0.4s ease-in-out;
}

/* ===== BACKWARD COMPATIBILITY ===== */
/* Support for templates using different class names */

/* .modern-form-wrapper wrapper from child templates */
.modern-form-wrapper {
    width: 100%;
}

/* .login-header used by OTP/2FA pages */
.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-header .login-logo {
    text-align: center;
    margin-bottom: 1rem;
}

.login-header .login-icon,
.login-header .login-logo i {
    display: block;
    margin: 0 auto;
    font-size: 3.5rem;
    color: var(--business-primary, #060d47);
    background: linear-gradient(135deg, rgba(6, 13, 71, 0.08) 0%, rgba(16, 160, 218, 0.08) 100%);
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
}

/* Success icon styling (password_reset_complete.html) */
.success-icon {
    text-align: center;
    margin-bottom: 1rem;
}

.success-icon i {
    font-size: 3.5rem;
    color: #22c55e;
}

/* Form actions (password_reset_complete.html) */
.form-actions {
    text-align: center;
    margin: 1.5rem 0;
}

.form-actions .modern-btn {
    display: inline-flex;
    width: auto;
    min-width: 180px;
}

/* Help text styling */
.help-text {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 0.8125rem;
    color: #4b5563;
}

.help-text i {
    color: #6b7280;
    flex-shrink: 0;
}

/* Password requirements box */
.password-requirements {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.requirements-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.requirements-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    font-size: 0.8125rem;
    color: #6b7280;
}

.requirement-item.valid {
    color: #22c55e;
}

.requirement-item.invalid {
    color: #ef4444;
}

.requirement-icon {
    font-size: 0.75rem;
}

/* ===== PASSWORD RESET PAGES ===== */

/* Back to Login Link - with more spacing */
.password-reset-options {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.back-to-login-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.back-to-login-link:hover {
    color: var(--business-primary, #060d47);
    background: #f3f4f6;
}

.back-to-login-link i {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.back-to-login-link:hover i {
    transform: translateX(-2px);
}

/* Icon Circles for Password Reset Pages */
.email-sent-icon,
.password-reset-icon,
.reset-complete-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-bottom: 1.25rem;
}

.icon-circle {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(6, 13, 71, 0.08) 0%, rgba(16, 160, 218, 0.12) 100%);
    position: relative;
    z-index: 1;
}

.icon-circle i {
    font-size: 1.75rem;
    color: var(--business-primary, #060d47);
}

.icon-circle.success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15) 0%, rgba(22, 163, 74, 0.2) 100%);
}

.icon-circle.success i {
    color: #22c55e;
}

/* Icon Animation Ring */
.icon-animation {
    position: absolute;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 2px solid rgba(16, 160, 218, 0.2);
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0;
    }
}

/* Success Particles Animation */
.success-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.success-particles span {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    opacity: 0;
    animation: particleBurst 1s ease-out forwards;
}

.success-particles span:nth-child(1) { top: 0; left: 50%; animation-delay: 0s; }
.success-particles span:nth-child(2) { top: 50%; right: 0; animation-delay: 0.1s; }
.success-particles span:nth-child(3) { bottom: 0; left: 50%; animation-delay: 0.2s; }
.success-particles span:nth-child(4) { top: 50%; left: 0; animation-delay: 0.3s; }

@keyframes particleBurst {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: scale(1.5) translateY(-10px);
        opacity: 0;
    }
}

/* Email Sent Page - Step Cards */
.email-sent-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1rem 0;
}

.email-sent-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.email-sent-step {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
}

.step-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--business-primary, #060d47) 0%, rgba(16, 160, 218, 0.8) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-icon i {
    font-size: 0.875rem;
    color: #ffffff;
}

.step-text {
    flex: 1;
    padding-top: 0.375rem;
}

.step-text p {
    margin: 0;
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.4;
}

.email-sent-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.8125rem;
    color: #6b7280;
}

.email-sent-note i {
    color: #9ca3af;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

/* Password Strength Indicator */
.password-strength-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.password-strength-bar {
    flex: 1;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.3s ease, background 0.3s ease;
}

.strength-label {
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 50px;
    text-align: right;
    transition: color 0.3s ease;
}

/* Modern Password Requirements */
.password-requirements-modern {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
}

.requirements-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.875rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.requirements-header i {
    color: var(--business-primary, #060d47);
}

.requirements-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.requirement-item-modern {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem 0;
    transition: all 0.2s ease;
}

.requirement-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.requirement-check i {
    font-size: 0.625rem;
    color: transparent;
    transition: color 0.2s ease;
}

.requirement-text {
    font-size: 0.8125rem;
    color: #6b7280;
    transition: color 0.2s ease;
}

.requirement-item-modern.valid .requirement-check {
    border-color: #22c55e;
    background: #22c55e;
}

.requirement-item-modern.valid .requirement-check i {
    color: #ffffff;
}

.requirement-item-modern.valid .requirement-text {
    color: #22c55e;
}

.requirement-item-modern.invalid .requirement-check {
    border-color: #ef4444;
}

.requirement-item-modern.invalid .requirement-text {
    color: #ef4444;
}

/* Reset Complete Page */
.reset-complete-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1rem 0;
}

.complete-message {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.complete-message i {
    color: #22c55e;
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.complete-message p {
    margin: 0;
    font-size: 0.9375rem;
    color: #374151;
    line-height: 1.5;
}

.security-tips {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-top: 1rem;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.8125rem;
    color: #6b7280;
}

.tip-item i {
    color: #9ca3af;
    font-size: 0.875rem;
    width: 1rem;
    text-align: center;
}

.reset-complete-actions {
    margin-top: 1.5rem;
    text-align: center;
}

.reset-complete-actions .modern-btn {
    width: auto;
    display: inline-flex;
    padding: 0.875rem 2rem;
}

.btn-arrow {
    display: inline-flex !important;
    font-size: 0.875rem;
    transition: transform 0.2s ease;
    margin-left: 0.25rem;
}

.modern-btn:hover .btn-arrow {
    transform: translateX(3px);
}

/* Hide arrow when button is loading */
.modern-btn.loading .btn-arrow {
    display: none !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .login-container {
        padding: 0.75rem;
    }

    .login-card {
        padding: 1.75rem 1.5rem;
        border-radius: 12px;
    }

    .login-branding {
        margin-bottom: 1.5rem;
        padding-bottom: 1.25rem;
    }

    .login-logo {
        height: 75px;
    }

    .form-title,
    .login-title {
        font-size: 1.375rem;
    }

    .form-subtitle,
    .login-subtitle {
        font-size: 0.875rem;
    }

    .modern-input {
        font-size: 16px; /* Prevents iOS zoom */
        padding: 0.75rem 0.875rem 0.75rem 2.5rem;
    }

    .modern-btn {
        font-size: 16px;
        padding: 0.75rem 1.25rem;
        min-height: 48px; /* Touch target */
    }

    .password-toggle {
        width: 44px;
        height: 44px;
    }

    /* Login Header Icon Mobile */
    .login-header .login-icon,
    .login-header .login-logo i {
        width: 64px;
        height: 64px;
        line-height: 64px;
        font-size: 2.5rem;
    }

    /* Password Reset Pages Mobile */
    .icon-circle {
        width: 64px;
        height: 64px;
    }

    .icon-circle i {
        font-size: 1.5rem;
    }

    .icon-animation {
        width: 80px;
        height: 80px;
    }

    .step-icon {
        width: 32px;
        height: 32px;
    }

    .step-icon i {
        font-size: 0.75rem;
    }

    .email-sent-card,
    .reset-complete-card,
    .password-requirements-modern {
        padding: 1rem;
    }
}

@media (max-width: 360px) {
    .login-card {
        padding: 1.5rem 1.25rem;
    }

    .form-title,
    .login-title {
        font-size: 1.25rem;
    }

    .form-subtitle,
    .login-subtitle {
        font-size: 0.8125rem;
    }

    .icon-circle {
        width: 56px;
        height: 56px;
    }

    .icon-circle i {
        font-size: 1.25rem;
    }
}
