/* ========================================
   Face Auth CSS — Yashil (Green) Theme v5
   ======================================== */

/* ---- Camera Container ---- */
.camera-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 12px auto;
    border-radius: 16px;
    overflow: hidden;
    background: #111;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}
.camera-container video {
    width: 100%;
    display: block;
    transform: scaleX(-1); /* Mirror effekt */
}
.face-overlay-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* transform: scaleX(-1) olib tashlandi — matn/raqamlar teskari ko'rinmasligi uchun.
       Oval va burchaklar simmetrik — mirror shart emas. */
}

/* ---- Face Mode (kengaytirilgan container) ---- */
.face-mode {
    max-width: 560px !important;
    width: 560px !important;
    height: auto !important;
    padding: 30px 36px !important;
    transition: all 0.35s ease;
}

/* ---- Status ---- */
.face-status {
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    margin: 10px 0;
    transition: all 0.3s ease;
}
.face-status.info {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}
.face-status.success {
    background: linear-gradient(135deg, #e8f5e9, #b9f6ca);
    color: #1b5e20;
    border: 1px solid #66bb6a;
    animation: pulseGreen 1.5s infinite;
}
.face-status.error {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #c62828;
    border: 1px solid #ef9a9a;
}

@keyframes pulseGreen {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(0, 230, 118, 0); }
}

/* ---- Result Section ---- */
.result-section {
    text-align: center;
    padding: 14px;
    margin: 10px 0;
    border-radius: 12px;
    background: #f5f5f5;
}
.result-icon {
    font-size: 42px;
    margin-bottom: 6px;
}
.result-message {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}
.result-user {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

/* ---- Divider ---- */
.face-divider {
    display: flex;
    align-items: center;
    margin: 18px 0;
}
.face-divider::before,
.face-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid #e0e0e0;
}
.face-divider span {
    padding: 0 14px;
    color: #aaa;
    font-size: 13px;
    font-weight: 500;
}

/* ---- Face Login Toggle Button (Yashil) ---- */
.face-login-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    border: 2px solid #2e7d32;
    border-radius: 12px;
    background: #fff;
    color: #2e7d32;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}
.face-login-toggle:hover {
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.35);
}
.face-login-toggle:hover svg {
    stroke: #fff;
}
.face-login-toggle .face-icon {
    display: flex;
    align-items: center;
}
.face-login-toggle .face-icon svg {
    stroke: #2e7d32;
    transition: stroke 0.3s ease;
}

/* ---- Face Login Section ---- */
.face-login-section {
    text-align: center;
}
.face-login-section h4 {
    font-weight: 700;
    color: #1b5e20;
    margin-bottom: 4px;
    font-size: 20px;
}
.face-section-subtitle {
    font-size: 13px;
    color: #757575;
    margin: 4px 0 16px;
}

/* ---- PINFL Input ---- */
.pinfl-input-wrapper {
    margin: 0 0 12px;
    text-align: left;
}
.pinfl-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pinfl-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 3px;
    text-align: center;
    border: 2px solid #c8e6c9;
    border-radius: 12px;
    background: #fafff9;
    color: #1b5e20;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}
.pinfl-input:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
    background: #fff;
}
.pinfl-input.input-error {
    border-color: #f44336;
    box-shadow: 0 0 0 3px rgba(244, 67, 54, 0.12);
    background: #fff5f5;
}
.pinfl-input::placeholder {
    color: #bbb;
    letter-spacing: 4px;
    font-weight: 400;
}
.pinfl-error {
    display: none;
    color: #e53935;
    font-size: 12px;
    font-weight: 500;
    margin-top: 6px;
    text-align: left;
    padding-left: 2px;
}

/* ---- Camera Start Button (Yashil) ---- */
.face-btn-start {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #2e7d32, #1b5e20);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(46, 125, 50, 0.3);
}
.face-btn-start:hover {
    background: linear-gradient(135deg, #388e3c, #2e7d32);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4);
}
.face-btn-start:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}
.face-btn-start svg {
    stroke: #fff;
}

/* ---- Retry Button ---- */
.face-btn-retry {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 24px;
    border: 2px solid #2e7d32;
    border-radius: 10px;
    background: #fff;
    color: #2e7d32;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}
.face-btn-retry:hover {
    background: #2e7d32;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

/* ---- Camera Error Box ---- */
.camera-error-box {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border: 1px solid #ffb74d;
    border-radius: 12px;
    padding: 20px;
    margin: 12px 0;
    text-align: center;
}
.camera-error-icon {
    font-size: 36px;
    margin-bottom: 8px;
}
.camera-error-text {
    font-size: 16px;
    font-weight: 700;
    color: #e65100;
    margin-bottom: 8px;
}
.camera-error-hint {
    font-size: 13px;
    color: #795548;
    line-height: 1.5;
    margin-bottom: 14px;
}

/* ---- Button Group ---- */
.face-btn-group {
    text-align: center;
    margin-top: 10px;
}

/* ---- Back-to-login link ---- */
.back-to-login {
    text-align: center;
    margin-top: 16px;
}
.back-to-login a {
    color: #2e7d32;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    padding: 6px 12px;
    border-radius: 8px;
}
.back-to-login a:hover {
    color: #1b5e20;
    background: #e8f5e9;
    text-decoration: none;
}

/* ---- Admin Face Management (agar kerak bo'lsa) ---- */
.face-username-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    margin: 8px 0;
    outline: none;
    transition: border-color 0.25s;
    box-sizing: border-box;
}
.face-username-input:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.12);
}

.face-card {
    border-radius: 14px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.08);
    padding: 18px;
    background: #fff;
}

.face-photo-thumb {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #2e7d32;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.face-upload-area {
    border: 2px dashed #bbb;
    border-radius: 14px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #fafafa;
}
.face-upload-area:hover {
    border-color: #2e7d32;
    background: #f1f8e9;
}
.face-upload-area.dragover {
    border-color: #2e7d32;
    background: #e8f5e9;
}

/* ---- Responsive ---- */
@media (max-width: 576px) {
    .camera-container { max-width: 100%; border-radius: 12px; }
    .face-mode { max-width: 100% !important; width: 100% !important; }
    .pinfl-input { font-size: 16px; letter-spacing: 2px; }
    .face-btn-start { padding: 12px 16px; font-size: 14px; }
}
