:root {
    --primary-orange: #ff6a00;
    --primary-hover: #e55e00;
    --bg-light: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #2d3748;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --error-color: #e53e3e;
    --success-color: #38a169;
    --info-color: #3182ce;
    --shadow-soft: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --border-radius: 10px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* Header */
.main-header {
    background-color: var(--card-bg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    padding: 15px 25px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-link {
    display: flex;
    align-items: center;
}

.logo {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.header-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-orange);
    letter-spacing: 0.5px;
}

/* Container & Login Card */
.container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}

.auth-card {
    background: var(--card-bg);
    width: 100%;
    max-width: 450px;
    padding: 40px 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0,0,0,0.02);
}

.auth-card h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 5px;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.92rem;
    color: #4a5568;
}

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

.input-wrapper input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    color: var(--text-main);
    transition: var(--transition);
    background-color: #fcfdfd;
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.12);
    background-color: #fff;
}

.input-icon {
    position: absolute;
    left: 15px;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.toggle-password {
    position: absolute;
    right: 15px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding: 5px;
}

.toggle-password svg {
    width: 20px;
    height: 20px;
}

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

.form-actions-link {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    margin-top: -5px;
}

.text-btn {
    background: none;
    border: none;
    color: var(--primary-orange);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.text-btn:hover {
    text-decoration: underline;
    color: var(--primary-hover);
}

/* Buttons */
.primary-btn {
    width: 100%;
    background-color: var(--primary-orange);
    color: #fff;
    border: none;
    padding: 13px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(255, 106, 0, 0.25);
}

.primary-btn:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.primary-btn:disabled {
    background-color: #feb272;
    cursor: not-allowed;
    box-shadow: none;
}

.secondary-btn {
    background-color: #e2e8f0;
    color: #4a5568;
    border: none;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.secondary-btn:hover {
    background-color: #cbd5e0;
}

.card-footer-link {
    text-align: center;
    margin-top: 25px;
    font-size: 0.92rem;
    color: var(--text-muted);
}

.card-footer-link a {
    color: var(--primary-orange);
    text-decoration: none;
    font-weight: 600;
}

.card-footer-link a:hover {
    text-decoration: underline;
}

/* Loader Spinner */
.loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

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

/* Custom Modal System Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 15px;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #fff;
    width: 100%;
    max-width: 420px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: var(--primary-orange);
    color: #fff;
}

.modal-header-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-svg-icon {
    width: 24px;
    height: 24px;
    stroke: #fff;
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
}

.modal-body {
    padding: 22px 20px;
    font-size: 1rem;
    color: var(--text-main);
}

.modal-footer {
    padding: 15px 20px;
    background-color: #f7fafc;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.error-details {
    margin-top: 15px;
    background: #fff5f5;
    color: #c53030;
    border: 1px solid #feb2b2;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.error-details summary {
    cursor: pointer;
    font-weight: 600;
}

.error-details pre {
    white-space: pre-wrap;
    word-break: break-all;
    margin-top: 8px;
    font-family: monospace;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .auth-card {
        padding: 30px 20px;
    }
    .header-title {
        font-size: 1.1rem;
    }
}
