/* Base styles from login.php */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

body {
    overflow: hidden;
}

.sso-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sso-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(133deg, #2d3748, #42526e);
    z-index: 0;
    overflow: hidden;
}

.sso-background::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent);
    border-radius: 50%;
    top: -300px;
    right: -300px;
    animation: float 12s ease-in-out infinite, pulse 4s ease-in-out infinite;
}

.sso-background::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent);
    border-radius: 50%;
    bottom: -250px;
    left: -250px;
    animation: float 15s ease-in-out infinite reverse, pulse 5s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(30px, -30px) rotate(90deg); }
    50% { transform: translate(60px, 30px) rotate(180deg); }
    75% { transform: translate(-30px, 60px) rotate(270deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 70%);
    filter: blur(60px);
}

.orb-1 {
    width: 300px;
    height: 300px;
    bottom: -150px;
    left: 10%;
    animation: bubbleRise1 20s ease-in-out infinite;
}

.orb-2 {
    width: 250px;
    height: 250px;
    bottom: -125px;
    left: 60%;
    animation: bubbleRise2 18s ease-in-out infinite 3s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: 35%;
    animation: bubbleRise3 22s ease-in-out infinite 6s;
}

@keyframes bubbleRise1 {
    0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { transform: translateY(-120vh) translateX(30px) scale(1.2); opacity: 0; }
}

@keyframes bubbleRise2 {
    0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
    10% { opacity: 0.5; }
    90% { opacity: 0.5; }
    100% { transform: translateY(-120vh) translateX(-40px) scale(1.3); opacity: 0; }
}

@keyframes bubbleRise3 {
    0% { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
    10% { opacity: 0.4; }
    90% { opacity: 0.4; }
    100% { transform: translateY(-120vh) translateX(20px) scale(1.1); opacity: 0; }
}

.sso-content {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 480px;
    padding: 20px;
}

.sso-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.3), 0 0 1px rgba(255, 255, 255, 0.3) inset;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    min-height: auto;
    height: auto;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.sso-header {
    text-align: center;
    margin-bottom: 40px;
}

.sso-logo-container {
    position: relative;
    max-width: 150px;
    max-height: 100px;
    margin: 0 auto 24px;
}

.sso-logo-icon {
    font-size: 64px;
    background: linear-gradient(133deg, #2d3748, #42526e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: iconPulse 3s ease-in-out infinite;
}

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

.sso-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.sso-subtitle {
    font-size: 14px;
    color: #718096;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.step-header {
    text-align: center;
    margin-bottom: 40px;
}

.step-header h3 {
    font-size: 28px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.step-header p {
    font-size: 14px;
    color: #718096;
    font-weight: 500;
}

.step-header i {
    font-size: 48px;
    margin-bottom: 20px;
    background: linear-gradient(133deg, #2d3748, #42526e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.input-group {
    position: relative;
    margin-bottom: 28px;
}

.input-group input {
    width: 100%;
    padding: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #f8fafc;
    color: #1a202c;
}

.input-group input:focus {
    outline: none;
    border-color: #42526e;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(66, 82, 110, 0.1);
}

.input-group input::placeholder {
    color: #a0aec0;
}

.login-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(133deg, #2d3748, #42526e);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(45, 55, 72, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(45, 55, 72, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

.alert {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: block !important;
    line-height: 1.6;
}

.alert i {
    font-size: 16px;
    margin-right: 8px;
}

.alert-success {
    background: rgba(56, 161, 105, 0.1) !important;
    border: 2px solid rgba(56, 161, 105, 0.3) !important;
    color: #22543d !important;
}

.alert-success i {
    color: #38a169 !important;
}

.alert-danger {
    background: rgba(229, 62, 62, 0.1) !important;
    border: 2px solid rgba(229, 62, 62, 0.3) !important;
    color: #742a2a !important;
}

.alert-danger i {
    color: #e53e3e !important;
}

.alert-info {
    background: rgba(49, 130, 206, 0.1) !important;
    border: 2px solid rgba(49, 130, 206, 0.3) !important;
    color: #2c5282 !important;
}

.alert-info i {
    color: #3182ce !important;
}

.back-to-login {
    text-align: center;
    margin-top: 25px;
}

.back-to-login a {
    color: #42526e;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-to-login a:hover {
    color: #2d3748;
    transform: translateX(-4px);
}

.back-to-login a i {
    font-size: 12px;
}

/* Registration specific styles */
.otp-input-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.otp-input {
    width: 50px;
    height: 50px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    color: #1a202c;
    transition: all 0.3s;
}

.otp-input:focus {
    outline: none;
    background: #fff;
    border-color: #42526e;
    box-shadow: 0 0 0 4px rgba(66, 82, 110, 0.1);
}

.retry-otp {
    text-align: center;
    margin-top: 15px;
    color: #1a202c;
    font-size: 14px;
    font-weight: 500;
}

.retry-otp a {
    color: #42526e;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 600;
}

#countdown {
    color: #1a202c !important;
    font-weight: 600;
}

.btn-cancel {
    width: 100%;
    padding: 18px;
    background: transparent;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    color: #4a5568;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 12px;
}

.btn-cancel:hover {
    background: #f8fafc;
    border-color: #cbd5e0;
    transform: translateY(-2px);
}

.password-strength {
    margin-bottom: 15px;
}

.strength-bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

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

.strength-fill.weak { width: 33%; background: #e53e3e; }
.strength-fill.medium { width: 66%; background: #dd6b20; }
.strength-fill.strong { width: 100%; background: #38a169; }

.strength-text {
    font-size: 13px;
    color: #718096;
}

.strength-text.weak { color: #e53e3e; }
.strength-text.medium { color: #dd6b20; }
.strength-text.strong { color: #38a169; }

.toggle-password {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    cursor: pointer;
    font-size: 16px;
    transition: color 0.3s;
}

.toggle-password:hover {
    color: #42526e;
}

.password-requirements {
    margin-bottom: 15px;
    font-size: 12px;
}

.req-item {
    color: #a0aec0;
    margin-bottom: 5px;
    transition: all 0.3s;
}

.req-item i {
    font-size: 8px;
    margin-right: 8px;
}

.req-item.valid {
    color: #38a169;
}

.req-item.valid i {
    color: #38a169;
}

.biometric-options {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.bio-card {
    flex: 1;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.bio-card:hover {
    background: #fff;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #42526e;
}

.bio-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bio-card.disabled:hover {
    transform: none;
    background: #f8fafc;
}

.bio-card i {
    font-size: 48px;
    background: linear-gradient(133deg, #2d3748, #42526e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

.bio-card h4 {
    color: #1a202c;
    font-size: 18px;
    margin-bottom: 8px;
}

.bio-card p {
    color: #718096;
    font-size: 13px;
    margin: 0;
}

.face-capture {
    position: relative;
    width: 100%;
    max-width: 500px;
    height: 400px;
    margin: 0 auto 20px;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
}

#videoElement, #updateVideoElement {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 20px;
    opacity: 0.8;
    object-fit: cover;
}

.face-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 350px;
    border: 4px solid rgba(0, 255, 0, 0.3);
    border-radius: 50%;
    box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.5), inset 0 0 30px rgba(0, 255, 0, 0.2);
    transition: all 0.3s ease;
    pointer-events: none;
}

.face-circle.active {
    border-color: #00ff00;
    box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.5), inset 0 0 50px rgba(0, 255, 0, 0.5), 0 0 40px rgba(0, 255, 0, 0.6);
    animation: circlePulse 1.5s ease-in-out infinite;
}

.face-circle.error {
    border-color: #ff0000;
    box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.5), inset 0 0 50px rgba(255, 0, 0, 0.5), 0 0 40px rgba(255, 0, 0, 0.6);
}

@keyframes circlePulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.02); }
}

.scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: none;
}

.scan-line {
    position: absolute;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #00ff00 20%, #00ff00 80%, transparent);
    box-shadow: 0 0 20px #00ff00, 0 0 40px rgba(0, 255, 0, 0.5);
    animation: scanMove 2.5s ease-in-out infinite;
}

@keyframes scanMove {
    0%, 100% { top: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

.scan-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 24px, rgba(0, 255, 0, 0.08) 25px),
        repeating-linear-gradient(90deg, transparent, transparent 24px, rgba(0, 255, 0, 0.08) 25px);
    animation: gridPulse 2s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

.aws-processing {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 40px 50px;
    border-radius: 15px;
    border: 3px solid #00ff00;
    box-shadow: 0 0 40px rgba(0, 255, 0, 0.7), inset 0 0 30px rgba(0, 255, 0, 0.2);
    display: none;
    text-align: center;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.aws-processing.active { display: block; animation: awsFadeIn 0.3s ease; }

@keyframes awsFadeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.spinner-ring {
    width: 80px;
    height: 80px;
    border: 5px solid rgba(0, 255, 0, 0.2);
    border-top-color: #00ff00;
    border-right-color: #00ff00;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

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

.aws-text {
    color: #00ff00;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

.progress-dots {
    color: #00ff00;
    font-size: 14px;
    margin-top: 12px;
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    animation: dotsPulse 1.5s ease-in-out infinite;
}

@keyframes dotsPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.face-status {
    text-align: center;
    color: #1a202c;
    font-size: 16px;
    margin-bottom: 15px;
    padding: 14px 18px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    font-weight: 600;
    transition: all 0.4s ease;
    min-height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

.face-status.detected {
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.15), rgba(0, 200, 0, 0.1));
    color: #00aa00;
    border-color: #00ff00;
    box-shadow: 0 4px 16px rgba(0, 255, 0, 0.3), inset 0 0 20px rgba(0, 255, 0, 0.1);
    animation: statusPulse 1.5s ease-in-out infinite;
}

.face-status.error {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.15), rgba(200, 0, 0, 0.1));
    color: #cc0000;
    border-color: #ff0000;
    box-shadow: 0 4px 16px rgba(255, 0, 0, 0.3), inset 0 0 20px rgba(255, 0, 0, 0.1);
}

@keyframes statusPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 16px rgba(0, 255, 0, 0.3), inset 0 0 20px rgba(0, 255, 0, 0.1); }
    50% { transform: scale(1.02); box-shadow: 0 6px 20px rgba(0, 255, 0, 0.5), inset 0 0 30px rgba(0, 255, 0, 0.2); }
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: 100%;
    height: 100%;
    display: none;
    background: rgba(45, 55, 72, 0.95);
    backdrop-filter: blur(10px);
}

.overlay-spinner {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: sp-anime 0.8s infinite linear;
    margin-bottom: 20px;
}

@keyframes sp-anime {
    100% { transform: rotate(360deg); }
}

.overlay-text {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

/* Alert styles matching login.php */
.jconfirm.jconfirm-material .jconfirm-box {
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    animation: alertBounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
    border: none !important;
}

@keyframes alertBounceIn {
    0% { opacity: 0; transform: scale(0.3) translateY(-50px); }
    50% { transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.jconfirm.jconfirm-material .jconfirm-box .jconfirm-title-c {
    font-weight: 700 !important;
    font-size: 20px !important;
    padding: 24px 24px 16px !important;
}

.jconfirm.jconfirm-material .jconfirm-box .jconfirm-content {
    font-size: 15px !important;
    color: #4a5568 !important;
    padding: 0 24px 24px !important;
    line-height: 1.6 !important;
}

.jconfirm.jconfirm-material.jconfirm-type-red .jconfirm-box {
    border-left: 5px solid #e53e3e !important;
}

.jconfirm.jconfirm-material.jconfirm-type-red .jconfirm-title-c {
    color: #e53e3e !important;
}

.jconfirm.jconfirm-material.jconfirm-type-green .jconfirm-box {
    border-left: 5px solid #38a169 !important;
}

.jconfirm.jconfirm-material.jconfirm-type-green .jconfirm-title-c {
    color: #38a169 !important;
}

.jconfirm .jconfirm-buttons {
    padding: 0 24px 24px !important;
}

.jconfirm .btn-red {
    background: linear-gradient(133deg, #e53e3e, #c53030) !important;
    border: none !important;
    padding: 12px 28px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.jconfirm .btn-red:hover {
    background: linear-gradient(133deg, #c53030, #9b2c2c) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(229, 62, 62, 0.4) !important;
}

.jconfirm .btn-green {
    background: linear-gradient(133deg, #38a169, #2f855a) !important;
    border: none !important;
    padding: 12px 28px !important;
    border-radius: 10px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.jconfirm .btn-green:hover {
    background: linear-gradient(133deg, #2f855a, #276749) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 20px rgba(56, 161, 105, 0.4) !important;
}

.jconfirm-bg {
    background: rgba(45, 55, 72, 0.8) !important;
    backdrop-filter: blur(8px) !important;
}

#step5 .sso-card {
    max-width: 600px;
    width: 100%;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .sso-card {
        padding: 36px 28px;
    }

    .sso-content {
        max-width: 100%;
    }

    .biometric-options {
        flex-direction: column;
    }
    
    .face-circle {
        width: 220px;
        height: 280px;
    }
}

@media (max-width: 480px) {
    .sso-card {
        padding: 30px 20px;
    }

    .step-header h3 {
        font-size: 24px;
    }

    .otp-input {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}
