/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Minimal neutral palette inspired by shadcn/ui */
    --primary-color: hsl(240 10% 3.9%); /* app bg */
    --surface: hsl(240 10% 6%); /* cards */
    --border: hsl(240 3.7% 15.9%);
    --text-primary: hsl(0 0% 98%);
    --text-secondary: hsl(240 5% 64.9%);
    --secondary-color: hsl(33 96% 57%); /* accent */
    --error: hsl(0 84% 60%);
    --success: hsl(142 70% 45%);
}

body {
    font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Oxygen, Ubuntu, Cantarell, "Inter", "SF Pro Display", sans-serif;
    background: var(--primary-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--primary-color);
}

/* Cards */
.login-card,
.signup-card {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    padding: 32px;
    width: 100%;
    max-width: 450px;
    border: 1px solid var(--border);
}

.signup-card {
    max-width: 700px;
}

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: 28px;
}

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

.tagline {
    color: var(--text-secondary);
    font-size: 13px;
}

/* Form Styles */
.auth-form h2 {
    font-size: 22px;
    margin-bottom: 6px;
    color: var(--text-primary);
}

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

.form-group {
    margin-bottom: 20px;
    flex: 1;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

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

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="date"],
select {
    width: 100%;
    padding: 10px 14px;
    background: var(--primary-color);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px hsl(33 96% 57% / 0.15);
}

input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

select {
    cursor: pointer;
}

select option {
    background: var(--primary-color);
    color: var(--text-primary);
}

small {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
    accent-color: var(--secondary-color);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 24px;
    font-size: 14px;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    text-align: center;
}

/* Icon button (small) */
.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
}
.btn-icon:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.btn-primary {
    background: var(--secondary-color);
    color: var(--primary-color);
    margin-bottom: 16px;
}

.btn-primary:hover {
    background: #ffb84d;
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

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

.btn-secondary:hover {
    background: rgba(242, 170, 76, 0.1);
}

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(16, 24, 32, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.hidden {
    display: none !important;
}

/* Divider */
.divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.divider::before,
.divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.divider span {
    background: var(--surface);
    padding: 0 12px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Links */
.link {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.link:hover {
    color: #ffb84d;
    text-decoration: underline;
}

/* Messages */
.error-message,
.success-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: slideIn 0.3s ease;
}

.error-message {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

.success-message {
    background: rgba(46, 213, 115, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .login-card,
    .signup-card {
        padding: 24px 20px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .logo {
        font-size: 24px;
    }

    .auth-form h2 {
        font-size: 20px;
    }
}

/* OTP Input Styles */
.otp-input {
    text-align: center;
    font-size: 24px;
    letter-spacing: 8px;
    font-weight: 600;
    font-family: "Courier New", monospace;
}

/* Resend Section */
.resend-section {
    text-align: center;
    margin: 24px 0;
}

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

.link-button {
    background: none;
    border: none;
    color: var(--secondary-color);
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.3s ease;
    padding: 0;
}

.link-button:hover {
    color: #ffb84d;
}

.link-button:disabled {
    color: var(--text-secondary);
    cursor: not-allowed;
    text-decoration: none;
}

#resendTimer {
    display: inline-block;
    color: var(--text-secondary);
    font-size: 14px;
    margin-left: 8px;
}

/* Modal (global) */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    z-index: 2000;
}

.modal.open {
    display: flex;
}

.modal-dialog {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.modal-title {
    color: var(--text-primary);
    font-size: 18px;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.form-row-2 {
    display: flex;
    gap: 12px;
}
.form-row-2 > div {
    flex: 1;
}

.form-hint {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 4px;
}

.input-error {
    border-color: var(--error);
    box-shadow: 0 0 0 4px hsl(0 84% 60% / 0.12);
}

.error-inline {
    color: var(--error);
    font-size: 12px;
}
