/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a1a1a;
    --primary-dark: #000000;
    --primary-light: #333333;
    --danger-color: #dc2626;
    --danger-dark: #b91c1c;
    --success-color: #059669;
    --warning-color: #f59e0b;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #d1d5db;
    --bg-gray: #f9fafb;
    --bg-white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(to bottom, #f3f4f6, #e5e7eb);
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    color: white;
    margin-top: 20px;
    font-size: 16px;
    font-weight: 500;
}

/* Container */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    padding: 20px 0 30px;
}

.logo-container {
    background: white;
    border-radius: 16px;
    padding: 16px 32px;
    display: inline-block;
    box-shadow: var(--shadow-lg);
}

.logo {
    height: 50px;
    width: auto;
    display: block;
}

/* Screen Management */
.screen {
    display: none;
    flex: 1;
    animation: fadeIn 0.3s ease-in-out;
}

.screen.active {
    display: block;
}

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

/* Card */
.card {
    background: var(--bg-white);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    margin-bottom: 20px;
}

.card-header {
    text-align: center;
    padding: 40px 30px 30px;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border-bottom: 1px solid var(--border-color);
}

.card-header.warning {
    background: linear-gradient(135deg, #fef3c7 0%, #ffffff 100%);
}

.card-header.success {
    background: linear-gradient(135deg, #d1fae5 0%, #ffffff 100%);
}

.icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 16px rgba(226, 116, 0, 0.3);
}

.icon-wrapper.danger {
    background: linear-gradient(135deg, var(--danger-color), #f87171);
    box-shadow: 0 8px 16px rgba(239, 68, 68, 0.3);
}

.icon-wrapper.success {
    background: linear-gradient(135deg, var(--success-color), #34d399);
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.3);
}

.icon {
    width: 40px;
    height: 40px;
    color: white;
}

.card-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.card-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Form */
.form {
    padding: 30px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-secondary);
    pointer-events: none;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-white);
    color: var(--text-primary);
    font-family: 'Cairo', sans-serif;
    transition: all 0.2s ease;
    appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(226, 116, 0, 0.1);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 1;
}

.form-input.with-prefix {
    padding-left: 70px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.eye-icon {
    width: 20px;
    height: 20px;
}

.form-help {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    padding: 24px 30px;
    background: var(--bg-gray);
    border-bottom: 1px solid var(--border-color);
}

.user-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 16px;
    flex-shrink: 0;
}

.user-avatar svg {
    width: 30px;
    height: 30px;
}

.user-details {
    flex: 1;
}

.user-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.user-phone {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Warning Box */
.warning-box {
    margin: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #fef3c7 0%, #fef9ec 100%);
    border: 2px solid #fbbf24;
    border-radius: 12px;
}

.warning-title {
    font-size: 16px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 8px;
}

.warning-text {
    font-size: 14px;
    color: #78350f;
    line-height: 1.6;
}

/* Data Section */
.data-section {
    padding: 30px;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.data-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.data-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--bg-gray);
    border-radius: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.data-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.data-icon {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.data-item h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.data-item p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Download Section */
.download-section {
    padding: 30px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-gray);
}

.download-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Confirmation Section */
.confirmation-section {
    padding: 30px;
    border-bottom: 1px solid var(--border-color);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.checkbox {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.checkbox-label span {
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: 0 4px 12px rgba(226, 116, 0, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(226, 116, 0, 0.4);
}

.btn-secondary {
    background: white;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-gray);
    border-color: var(--text-secondary);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #f87171);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(239, 68, 68, 0.4);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.button-group {
    display: flex;
    gap: 12px;
    padding: 30px;
}

.button-group .btn {
    flex: 1;
}

/* Success Content */
.success-content {
    padding: 30px;
}

.success-text {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.7;
}

.info-box {
    background: var(--bg-gray);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.info-box h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.info-list {
    list-style: none;
    padding: 0;
}

.info-list li {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    line-height: 1.6;
}

.info-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

.success-content .btn {
    width: 100%;
    margin-top: 10px;
}

/* Error Message */
.error-message {
    background: #fee2e2;
    border: 2px solid var(--danger-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    color: #991b1b;
    font-size: 14px;
    font-weight: 500;
}

.error-message.hidden {
    display: none;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

.footer p {
    margin-bottom: 12px;
    opacity: 0.9;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.footer-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.separator {
    opacity: 0.6;
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        padding: 12px;
    }

    .card {
        border-radius: 16px;
    }

    .card-header {
        padding: 30px 20px 24px;
    }

    .card-title {
        font-size: 24px;
    }

    .icon-wrapper {
        width: 70px;
        height: 70px;
    }

    .icon {
        width: 35px;
        height: 35px;
    }

    .form,
    .data-section,
    .download-section,
    .confirmation-section,
    .success-content {
        padding: 24px 20px;
    }

    .button-group {
        flex-direction: column;
        padding: 24px 20px;
    }

    .user-info {
        padding: 20px;
    }

    .warning-box {
        margin: 24px 20px;
        padding: 16px;
    }

    .logo-container {
        padding: 12px 24px;
    }

    .logo {
        height: 40px;
    }

    .data-item {
        padding: 12px;
    }

    .section-title {
        font-size: 16px;
    }
}

@media (min-width: 768px) {
    .container {
        padding: 40px 20px;
    }

    .header {
        padding: 30px 0 40px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}
