/* ==================== ROOT VARIABLES ==================== */
:root {
    --primary-color: #14b8a6;
    --primary-dark: #0f766e;
    --primary-light: #5eead4;
    --secondary-color: #06b6d4;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-color: #1f2937;
    --light-color: #f3f4f6;
    --white: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== GLOBAL STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #ecfeff 0%, #ffffff 50%, #f0fdfa 100%);
    min-height: 100vh;
    color: var(--dark-color);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== APP WRAPPER ==================== */
.app-wrapper {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 16px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 28px 24px;
    width: 100%;
    position: relative;
    overflow: hidden;
}

    .app-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    }

/* ==================== HEADER ==================== */
.app-header {
    text-align: center;
    margin-bottom: 28px;
}

.icon-badge {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 20px rgba(20, 184, 166, 0.25);
    animation: pulse 2s ease-in-out infinite;
}

    .icon-badge i {
        font-size: 32px;
        color: var(--white);
    }

.app-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.app-subtitle {
    font-size: 14px;
    color: #6b7280;
    font-weight: 400;
    margin: 0;
}

/* ==================== STEPPER ==================== */
.stepper-wrapper {
    margin-bottom: 32px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

    .stepper-wrapper::-webkit-scrollbar {
        display: none;
    }

.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: max-content;
    padding: 4px 0;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 60px;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: var(--transition);
    border: 3px solid transparent;
}

.step-number {
    font-size: 15px;
    font-weight: 700;
    color: #9ca3af;
    transition: var(--transition);
}

.step-icon {
    font-size: 16px;
    color: var(--white);
    display: none;
}

.step-label {
    font-size: 11px;
    font-weight: 500;
    color: #9ca3af;
    text-align: center;
    transition: var(--transition);
    white-space: nowrap;
}

.step-line {
    flex: 1;
    height: 3px;
    background: #e5e7eb;
    margin: 0 -8px;
    margin-bottom: 28px;
    transition: var(--transition);
}

/* Stepper Active States */
.step-item.active .step-circle {
    background: var(--primary-color);
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
    transform: scale(1.1);
}

.step-item.active .step-number {
    color: var(--white);
}

.step-item.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

.step-item.completed .step-circle {
    background: var(--success-color);
    border-color: #6ee7b7;
}

.step-item.completed .step-number {
    display: none;
}

.step-item.completed .step-icon {
    display: block;
}

.step-item.completed .step-label {
    color: var(--success-color);
}

.step-item.completed + .step-line {
    background: var(--success-color);
}

/* ==================== STEP CONTENT ==================== */
.step-content {
    display: none;
    animation: fadeInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

    .step-content.active {
        display: block;
    }

.step-inner {
    width: 100%;
}

.step-icon-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
}

.camera-icon {
    background: linear-gradient(135deg, #ec4899, #f472b6);
    color: var(--white);
    box-shadow: 0 8px 24px rgba(236, 72, 153, 0.3);
}

.thumb-icon {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
    color: var(--white);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
}

.step-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 10px;
    text-align: center;
}

.step-description {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    margin-bottom: 28px;
    line-height: 1.6;
}

/* ==================== PERMISSION CARD ==================== */
.permission-card {
    background: #f9fafb;
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
    border: 2px solid #e5e7eb;
}

.permission-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.permission-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}

.permission-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--white);
    flex-shrink: 0;
}

.permission-info h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 2px;
}

.permission-info p {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

/* ==================== BADGE STATUS ==================== */
.badge-status {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    transition: var(--transition);
}

    .badge-status.denied {
        background: #fee2e2;
        color: #dc2626;
    }

    .badge-status.granted {
        background: #d1fae5;
        color: #059669;
    }

    .badge-status i {
        font-size: 10px;
    }

/* ==================== EMPLOYEE CARD ==================== */
.employee-card {
    background: #f9fafb;
    border-radius: var(--radius-md);
    padding: 24px 20px;
    margin-bottom: 24px;
    border: 2px solid #e5e7eb;
}

.employee-profile {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.employee-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: 0 4px 16px rgba(20, 184, 166, 0.2);
}

    .employee-avatar i {
        font-size: 36px;
        color: var(--white);
    }

.employee-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 4px;
}

.employee-id {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
    margin: 0;
}

.detail-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e5e7eb;
}

    .detail-row:last-child {
        border-bottom: none;
    }

.detail-label {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .detail-label i {
        color: var(--primary-color);
        width: 16px;
    }

.detail-value {
    font-size: 14px;
    color: var(--dark-color);
    font-weight: 600;
    text-align: right;
}

/* ==================== FORM ELEMENTS ==================== */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 10px;
}

    .form-label i {
        color: var(--primary-color);
    }

.form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--dark-color);
    transition: var(--transition);
    font-family: 'Poppins', sans-serif;
}

    .form-input:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.1);
    }

    .form-input::placeholder {
        color: #9ca3af;
    }

.form-hint {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 8px;
}

/* ==================== CAMERA ==================== */
.camera-wrapper {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
    background: #000;
}

.camera-preview {
    width: 100%;
    display: block;
    border-radius: var(--radius-md);
}

.camera-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.face-guide {
    width: 70%;
    aspect-ratio: 3/4;
    position: relative;
}

.guide-corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid var(--primary-color);
}

    .guide-corner.tl {
        top: 0;
        left: 0;
        border-right: none;
        border-bottom: none;
        border-radius: 12px 0 0 0;
    }

    .guide-corner.tr {
        top: 0;
        right: 0;
        border-left: none;
        border-bottom: none;
        border-radius: 0 12px 0 0;
    }

    .guide-corner.bl {
        bottom: 0;
        left: 0;
        border-right: none;
        border-top: none;
        border-radius: 0 0 0 12px;
    }

    .guide-corner.br {
        bottom: 0;
        right: 0;
        border-left: none;
        border-top: none;
        border-radius: 0 0 12px 0;
    }

.camera-instructions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    background: #fef3c7;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-size: 13px;
    color: #92400e;
}

    .camera-instructions i {
        color: #f59e0b;
        font-size: 18px;
    }

/* ==================== PREVIEW ==================== */
.preview-card {
    background: #f9fafb;
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

.preview-image-wrapper {
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.preview-image {
    width: 100%;
    display: block;
    border-radius: var(--radius-md);
}

.employee-details {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: 16px;
}

/* ==================== SUCCESS ==================== */
.success-animation {
    margin-bottom: 24px;
}

.success-circle {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--success-color), #34d399);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.3);
    animation: scaleIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

    .success-circle i {
        font-size: 48px;
        color: var(--white);
    }

.success-title {
    color: var(--success-color);
}

.success-details {
    background: #f0fdf4;
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
}

.success-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 14px;
    color: var(--dark-color);
    font-weight: 500;
}

    .success-item i {
        color: var(--success-color);
        font-size: 18px;
        width: 24px;
    }

/* ==================== BUTTONS ==================== */
.btn-primary,
.btn-secondary,
.btn-outline {
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    box-shadow: 0 4px 14px rgba(20, 184, 166, 0.3);
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(20, 184, 166, 0.4);
    }

    .btn-primary:active {
        transform: translateY(0);
    }

.btn-secondary {
    background: var(--secondary-color);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

    .btn-secondary:hover {
        background: #0891b2;
        transform: translateY(-2px);
    }

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

    .btn-outline:hover {
        background: var(--primary-color);
        color: var(--white);
    }

.button-group {
    display: flex;
    gap: 12px;
}

.w-100 {
    width: 100%;
}

.flex-1 {
    flex: 1;
}

.d-none {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* ==================== LOADER ==================== */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.loader-content {
    text-align: center;
    animation: fadeIn 0.3s ease-in-out;
}

.spinner {
    width: 64px;
    height: 64px;
    border: 5px solid #e5e7eb;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

.loader-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 20px rgba(20, 184, 166, 0.25);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 30px rgba(20, 184, 166, 0.35);
    }
}

/* ==================== RESPONSIVE DESIGN ==================== */

/* Extra Small Devices (Phones in portrait, <576px) */
@media (max-width: 575.98px) {
    .app-wrapper {
        padding: 12px 12px;
    }

    .app-card {
        padding: 20px 16px;
    }

    .app-title {
        font-size: 22px;
    }

    .app-subtitle {
        font-size: 13px;
    }

    .icon-badge {
        width: 56px;
        height: 56px;
    }

        .icon-badge i {
            font-size: 28px;
        }

    .step-circle {
        width: 36px;
        height: 36px;
    }

    .step-number {
        font-size: 14px;
    }

    .step-label {
        font-size: 10px;
    }

    .step-title {
        font-size: 20px;
    }

    .step-description {
        font-size: 13px;
    }

    .btn-primary,
    .btn-secondary,
    .btn-outline {
        padding: 12px 20px;
        font-size: 14px;
    }

    .button-group {
        flex-direction: column;
    }

        .button-group .btn-outline {
            order: 2;
        }

        .button-group .btn-primary {
            order: 1;
        }

    .employee-avatar {
        width: 70px;
        height: 70px;
    }

        .employee-avatar i {
            font-size: 32px;
        }

    .employee-name {
        font-size: 18px;
    }
}

/* Small Devices (Phones in landscape, 576px to 767px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .app-wrapper {
        padding: 16px;
    }
}

/* Medium Devices (Tablets, 768px to 991px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .app-wrapper {
        max-width: 540px;
        padding: 24px 20px;
    }

    .app-card {
        padding: 32px 28px;
    }
}

/* Large Devices (Desktops, 992px and up) */
@media (min-width: 992px) {
    .app-wrapper {
        max-width: 600px;
        padding: 32px 24px;
    }

    .app-card {
        padding: 40px 36px;
    }

    .step-title {
        font-size: 24px;
    }

    .step-description {
        font-size: 15px;
    }
}

/* Landscape Orientation */
@media (max-height: 600px) and (orientation: landscape) {
    .app-wrapper {
        padding: 12px;
        align-items: flex-start;
    }

    .step-icon-large {
        width: 60px;
        height: 60px;
        font-size: 28px;
        margin-bottom: 12px;
    }

    .app-header {
        margin-bottom: 16px;
    }

    .stepper-wrapper {
        margin-bottom: 20px;
    }

    .success-circle {
        width: 80px;
        height: 80px;
    }

        .success-circle i {
            font-size: 36px;
        }
}

/* Print Styles */
@media print {
    .app-wrapper {
        padding: 0;
    }

    .app-card {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }

    .btn-primary,
    .btn-secondary,
    .btn-outline,
    .stepper-wrapper {
        display: none;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .preview-image,
    .camera-preview {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
