/* bidadoo Login — Custom Entra External ID Login Page */

:root {
    --bdo-red: #c82319;
    --bdo-red-hover: #a51d14;
    --bdo-red-active: #8a1810;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #888888;
    --border: #d0d0d0;
    --border-focus: #c82319;
    --bg-page: #f5f5f5;
    --bg-card: #ffffff;
    --bg-input: #ffffff;
    --error-red: #d32f2f;
    --error-bg: #fdecea;
    --radius: 6px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: 'Roboto', -apple-system, 'Segoe UI', sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 24px;
}

.login-card {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 40px 36px;
    position: relative;
}

.logo-section {
    margin-bottom: 24px;
}

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

h1 {
    font-size: 22px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 24px;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color 0.15s;
    outline: none;
}

.form-group input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px rgba(200, 35, 25, 0.12);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

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

.btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    color: #ffffff;
    background-color: var(--bdo-red);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background-color 0.15s;
    margin-top: 4px;
}

.btn-primary:hover {
    background-color: var(--bdo-red-hover);
}

.btn-primary:active {
    background-color: var(--bdo-red-active);
}

.btn-primary:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.btn-google {
    width: 100%;
    padding: 11px 12px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-primary);
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.15s, border-color 0.15s;
}

.btn-google:hover {
    background-color: #f8f8f8;
    border-color: #bbb;
}

.google-icon {
    flex-shrink: 0;
}

.microsoft-btn-wrapper {
    margin-top: 8px;
}

.btn-microsoft {
    width: 100%;
    padding: 11px 12px;
    font-size: 15px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-primary);
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background-color 0.15s, border-color 0.15s;
}

.btn-microsoft:hover {
    background-color: #f8f8f8;
    border-color: #bbb;
}

.microsoft-icon {
    flex-shrink: 0;
}

.microsoft-hidden-form {
    display: none;
}

.btn-link {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    margin-top: 4px;
}

.btn-link:hover {
    color: var(--bdo-red);
    text-decoration: underline;
}

.input-validation-error {
    border-color: var(--error-red) !important;
}

.field-error {
    color: var(--error-red);
    font-size: 13px;
    margin-top: 4px;
}

.forgot-password {
    margin-top: 12px;
    text-align: center;
    font-size: 14px;
}

.forgot-password a {
    color: var(--text-secondary);
    text-decoration: none;
}

.forgot-password a:hover {
    color: var(--bdo-red);
    text-decoration: underline;
}

.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 13px;
}

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

.divider span {
    padding: 0 16px;
}

.switch-view {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 24px;
}

.switch-view a {
    color: var(--bdo-red);
    text-decoration: none;
    font-weight: 500;
}

.switch-view a:hover {
    text-decoration: underline;
}

.signin-email-display {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: var(--radius);
}

.otp-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.5;
}

.error-message {
    background: var(--error-bg);
    color: var(--error-red);
    font-size: 14px;
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    line-height: 1.4;
}

/* asp-validation-summary renders errors as <ul><li> — strip list chrome */
.error-message ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.success-message {
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 14px;
    padding: 10px 14px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    line-height: 1.4;
}

.error-message:empty,
.validation-summary-valid {
    display: none;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

.loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--bdo-red);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.footer {
    text-align: center;
    padding: 16px 0;
    font-size: 12px;
    color: var(--text-muted);
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
}

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

.footer-sep {
    margin: 0 8px;
}

.google-hidden-form {
    display: none;
}

.error-help {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 16px;
    line-height: 1.5;
}

.error-status-code {
    font-size: 24px;
    font-weight: 700;
    color: var(--bdo-red);
    line-height: 1;
    margin-bottom: 8px;
}

.request-id {
    font-size: 12px;
    color: #999;
    margin-bottom: 16px;
}

.btn-block {
    display: block;
    text-align: center;
    text-decoration: none;
}

/* App Selector (/Select page) */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.app-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 16px;
    min-height: 160px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-primary);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.app-card:hover {
    border-color: var(--bdo-red);
    box-shadow: 0 2px 8px rgba(200, 35, 25, 0.12);
}

.app-card-name {
    font-size: 16px;
    font-weight: 500;
}

.app-card-last-login {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
}

/* Responsive */
@media (max-width: 480px) {
    .login-container {
        padding: 16px;
    }
    .login-card {
        padding: 32px 24px;
    }
}
