/* ============================================================
   Auth styles for OxiCloud — design tokens from variables.css
   ============================================================ */

.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100%;
    background-color: var(--color-bg-page);
}

.auth-panel {
    width: 420px;
    max-width: 90%;
    margin: 0 auto;
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: 0 8px 30px var(--color-shadow);
    padding: 36px;
    text-align: center;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.auth-logo-icon {
    width: 52px;
    height: 52px;
    background: var(--color-accent-gradient);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    box-shadow: 0 4px 12px var(--color-accent-shadow);
}

.auth-logo-icon svg {
    width: 30px;
    height: 30px;
    fill: var(--color-danger-text);
}

.auth-logo-text {
    font-size: 24px;
    font-weight: bold;
    color: var(--color-text);
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 28px;
    color: var(--color-text-heading);
}

.auth-form {
    width: 100%;
    text-align: left;

    [dir="rtl"] & {
        text-align: right;
    }
}

.auth-input-group {
    margin-bottom: 20px;
}

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

.auth-input {
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    border: 2px solid var(--color-border);
    font-size: 15px;
    background-color: var(--color-bg-input);
    color: var(--color-text);
    transition: all 0.2s ease;
}

.auth-input::placeholder {
    color: var(--color-text-faint);
}

.auth-input:hover {
    border-color: var(--color-accent);
    background-color: var(--color-bg-surface);
}

.auth-input:focus {
    outline: none;
    border-color: var(--color-accent);
    background-color: var(--color-bg-surface);
    box-shadow: 0 0 0 3px var(--color-accent-ring);
}

.auth-input[readonly] {
    opacity: 0.7;
    cursor: default;
}

.auth-button {
    width: 100%;
    padding: 14px 18px;
    border-radius: 12px;
    background: var(--color-accent-gradient);
    color: var(--color-danger-text);
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    margin-top: 12px;
    box-shadow: 0 4px 12px var(--color-accent-shadow);
}

.auth-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--color-accent-shadow-lg);
    filter: brightness(1.05);
}

.auth-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--color-accent-shadow);
}

.auth-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    filter: none;
}

.auth-subtitle {
    margin: 20px 0;
    color: var(--color-text-muted);
    font-size: 14px;
}
.auth-action-wrap {
    margin-top: 20px;
}

/* SSO / OIDC button */
.auth-button-oidc {
    background: linear-gradient(135deg, var(--color-text) 0%, var(--color-text-secondary) 100%);
    box-shadow: 0 4px 12px var(--color-shadow-3xl);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-button-oidc:hover {
    box-shadow: 0 6px 20px var(--color-shadow-4xl);
}

.auth-button-sso {
    background: var(--color-oidc-bg);
    box-shadow: 0 4px 12px var(--color-oidc-shadow);
}
.auth-button-sso:hover {
    box-shadow: 0 6px 20px var(--color-oidc-shadow-lg);
}

.auth-button-oidc i {
    font-size: 14px;
}

/* Divider between password and SSO login */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--color-text-faint);
    font-size: 13px;
}

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

.auth-divider span {
    padding: 0 12px;
}

/* OIDC-only mode: hide password form */
.auth-form.hidden {
    display: none;
}

.auth-toggle {
    margin-top: 22px;
    font-size: 14px;
    color: var(--color-text-muted);
}

.auth-toggle-link {
    color: var(--color-accent);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
}

.auth-toggle-link:hover {
    text-decoration: underline;
}

.auth-error {
    background-color: var(--color-error-bg);
    color: var(--color-error-text);
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.auth-success {
    background-color: var(--color-success-bg);
    color: var(--color-success-text);
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

/* Admin setup panel styles — visibility controlled via .hidden class */

.setup-steps {
    margin-bottom: 28px;
    display: flex;
    justify-content: center;
    gap: 32px;
}

.setup-step {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-number {
    width: 34px;
    height: 34px;
    background-color: var(--color-bg-input);
    border: 2px solid var(--color-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-faint);
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
    transition: all 0.2s ease;
}

.step-number.active {
    background: var(--color-accent-gradient);
    border-color: transparent;
    color: var(--color-danger-text);
    box-shadow: 0 2px 8px var(--color-accent-shadow);
}

.step-title {
    font-size: 12px;
    color: var(--color-text-faint);
    font-weight: 500;
}

.step-title.active {
    color: var(--color-text-heading);
    font-weight: 600;
}

/* Language selector panel styles */
.language-selector-panel {
    text-align: center;
}

.language-subtitle {
    color: var(--color-text-muted);
    font-size: 16px;
    margin-bottom: 24px;
}

/* ====== Compact Language Picker ====== */
.lang-picker {
    position: relative;
    margin-bottom: 24px;
    text-align: left;
}

.lang-picker-selected {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    border: 2px solid var(--color-border);
    border-radius: 12px;
    cursor: pointer;
    background-color: var(--color-bg-input);
    transition: all 0.2s ease;
    user-select: none;
}

.lang-picker-selected:hover {
    border-color: var(--color-accent);
    background-color: var(--color-bg-surface);
}

.lang-picker.open .lang-picker-selected {
    border-color: var(--color-accent);
    background-color: var(--color-bg-surface);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: 0 0 0 3px var(--color-accent-ring);
}

.lang-picker-flag {
    font-size: 26px;
    margin-right: 14px;
    flex-shrink: 0;
}

.lang-picker-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-heading);
    flex: 1;
}

.lang-picker-arrow {
    color: var(--color-text-faint);
    font-size: 13px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.lang-picker.open .lang-picker-arrow {
    transform: rotate(180deg);
}

/* Dropdown */
.lang-picker-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg-surface);
    border: 2px solid var(--color-accent);
    border-top: 1px solid var(--color-border-light);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    box-shadow: 0 12px 32px var(--color-shadow-lg);
    z-index: 100;
    overflow: hidden;
}

.lang-picker.open .lang-picker-dropdown {
    display: block;
    animation: langPickerSlideDown 0.2s ease;
}

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

/* Search inside dropdown */
.lang-picker-search {
    position: relative;
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border-light);
}

.lang-picker-search i {
    position: absolute;
    left: 26px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-faint);
    font-size: 13px;
}

.lang-picker-search input {
    width: 100%;
    padding: 8px 12px 8px 32px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    background-color: var(--color-bg-input);
    color: var(--color-text);
    transition: border-color 0.2s;
}

.lang-picker-search input::placeholder {
    color: var(--color-text-faint);
}

.lang-picker-search input:focus {
    border-color: var(--color-accent);
}

/* Scrollable list */
.lang-picker-list {
    max-height: 240px;
    overflow-y: auto;
    padding: 6px;
}

/* Language item in dropdown */
.lang-picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.12s ease;
}

.lang-picker-item:hover {
    background: var(--color-bg-hover);
}

.lang-picker-item.selected {
    background: var(--color-accent-tint);
}

.lang-picker-item-flag {
    font-size: 22px;
    flex-shrink: 0;
}

.lang-picker-item-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-heading);
}

.lang-picker-item-english {
    font-size: 13px;
    color: var(--color-text-faint);
    margin-left: auto;
}

.lang-picker-item-check {
    color: var(--color-accent);
    font-size: 13px;
    flex-shrink: 0;
}

.lang-picker-empty {
    text-align: center;
    color: var(--color-text-faint);
    padding: 20px;
    font-size: 14px;
}

@media (max-width: 480px) {
    .auth-panel {
        width: 95%;
        padding: 24px;
    }

    .lang-picker-selected {
        padding: 12px 14px;
    }

    .lang-picker-list {
        max-height: 200px;
    }
}
