/**
 * eDoktor Portal - Auth Page Styles
 *
 * Used by prijava.php and registracija.php.
 * Design tokens: blue (#3b82f6), teal (#14b8a6), Inter Tight font.
 */

/* ── Reset & Custom Properties ── */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --blue: #3b82f6;
    --blue-dark: #2563eb;
    --teal: #14b8a6;
    --teal-dark: #0d9488;
    --dark: #1e293b;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --border: #e2e8f0;
    --light: #f8fafc;
    --white: #ffffff;
    --font: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --error-bg: #fef2f2;
    --error-border: #fecaca;
    --error-text: #dc2626;
    --success-bg: #f0fdf4;
    --success-border: #bbf7d0;
    --success-text: #16a34a;
    --info-bg: #eff6ff;
    --info-border: #bfdbfe;
    --info-text: #2563eb;
}

body {
    font-family: var(--font);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--light);
    padding: 24px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Auth Page Container ── */

.auth-page {
    max-width: 440px;
    width: 100%;
    margin-bottom: 60px;
    padding: 0 16px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo a {
    text-decoration: none;
}

.auth-logo img {
    height: 48px;
    width: auto;
}

.auth-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    text-align: center;
    margin-bottom: 8px;
}

.auth-card .auth-subtitle {
    font-size: 14px;
    color: var(--gray);
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* ── Form Elements ── */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-form label {
    font-size: 14px;
    font-weight: 500;
    color: var(--dark);
}

.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 16px;
    color: var(--dark);
    background: var(--white);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.auth-form input::placeholder {
    color: var(--gray-light);
}

.auth-form button[type="submit"] {
    width: 100%;
    padding: 12px;
    background: var(--blue);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    margin-top: 4px;
}

.auth-form button[type="submit"]:hover {
    background: var(--blue-dark);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.auth-form button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ── Google Sign-In Button ── */

.auth-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px;
    background: var(--white);
    color: var(--dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.auth-google-btn:hover {
    background: var(--light);
    border-color: #cbd5e1;
}

.auth-google-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* ── Google Sign-In Container ── */

#googleBtnContainer {
    padding: 8px 16px;
}

#googleBtnContainer iframe,
#googleBtnContainer > div {
    width: 100% !important;
    max-width: 100%;
}

/* ── Divider ── */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    font-size: 13px;
    color: var(--gray-light);
    font-weight: 500;
}

/* ── Alert Messages ── */

.auth-error {
    display: none;
    padding: 12px 16px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: 8px;
    color: var(--error-text);
    font-size: 14px;
    line-height: 1.5;
}

.auth-error.visible {
    display: block;
}

.auth-success {
    display: block;
    padding: 12px 16px;
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    border-radius: 8px;
    color: var(--success-text);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.auth-message {
    display: block;
    padding: 12px 16px;
    background: var(--info-bg);
    border: 1px solid var(--info-border);
    border-radius: 8px;
    color: var(--info-text);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* ── Links ── */

.auth-links {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--gray);
}

.auth-links a,
.auth-link {
    color: var(--blue);
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover,
.auth-link:hover {
    text-decoration: underline;
}

.auth-links p {
    margin-bottom: 8px;
}

.auth-links p:last-child {
    margin-bottom: 0;
}

/* ── Spinner ── */

.auth-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: auth-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

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

/* ── Responsive ── */

@media (max-width: 480px) {
    body {
        padding: 16px 0;
    }

    .auth-page {
        max-width: 100%;
        padding: 0 16px;
        margin-bottom: 40px;
    }

    .auth-card {
        border-radius: 12px;
        padding: 28px 20px;
    }

    .auth-logo {
        margin-bottom: 20px;
    }
}
