/* ═══════════════════════════════════════════════════════════════════════════
   Auth Modals — Login / Register
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.auth-modal.in { opacity: 1; }

.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.auth-modal-card {
    position: relative;
    width: 420px;
    max-width: 100%;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: #fff;
    border-radius: 24px;
    padding: 32px 28px 28px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.04);
    transform: scale(0.92) translateY(16px);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    scrollbar-width: thin;
}

.auth-modal.in .auth-modal-card { transform: scale(1) translateY(0); }

/* Close button */
.auth-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.04);
    border: none;
    color: #78716c;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}

.auth-modal-close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #1c1917;
}

/* Header */
.auth-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-modal-logo { margin-bottom: 16px; }

.auth-modal-header h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: #1c1917;
    margin: 0 0 4px;
    letter-spacing: -0.02em;
}

.auth-modal-header p {
    font-size: 0.875rem;
    color: #78716c;
    margin: 0;
}

.auth-modal-gradient {
    background: linear-gradient(135deg, #10b981, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Top row (back button + step label) */
.auth-modal-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.auth-modal-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #78716c;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.2s;
}

.auth-modal-back:hover { color: #10b981; }

.auth-modal-step-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #a8a29e;
}

/* Alert / errors */
.auth-modal-alert {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 16px;
    text-align: center;
}

/* Form */
.auth-modal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-modal-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-modal-field label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #57534e;
}

.auth-modal-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: #fafaf9;
    border: 1.5px solid #e7e5e4;
    border-radius: 12px;
    padding: 0 14px;
    height: 46px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-modal-input-wrap:focus-within {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.auth-modal-input-wrap > i:first-child {
    color: #a8a29e;
    font-size: 14px;
    margin-right: 10px;
    flex-shrink: 0;
}

.auth-modal-input-wrap input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 0.9375rem;
    color: #1c1917;
    font-family: inherit;
    height: 100%;
    min-width: 0;
}

.auth-modal-input-wrap input::placeholder { color: #a8a29e; }

/* Prefix (lomilink.et/) */
.auth-modal-input-prefix { padding-left: 0; }

.auth-modal-prefix {
    padding-left: 14px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #a8a29e;
    white-space: nowrap;
    user-select: none;
}

.auth-modal-input-prefix input { padding-left: 2px; }

/* Password toggle */
.auth-modal-eye {
    background: none;
    border: none;
    color: #a8a29e;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.auth-modal-eye:hover { color: #78716c; }

/* Checkbox */
.auth-modal-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.8125rem;
    color: #78716c;
    cursor: pointer;
    user-select: none;
}

.auth-modal-check input { margin-top: 2px; accent-color: #10b981; }

.auth-modal-check a {
    color: #10b981;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-modal-check a:hover { color: #059669; }

/* Submit button */
.auth-modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.auth-modal-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

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

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

/* Switch link */
.auth-modal-switch {
    text-align: center;
    font-size: 0.8125rem;
    color: #78716c;
    margin-top: 16px;
}

.auth-modal-switch button {
    background: none;
    border: none;
    color: #10b981;
    font-weight: 600;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-modal-switch button:hover { color: #059669; }

/* Chosen category badge */
.auth-modal-chosen {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.8125rem;
    color: #059669;
    margin-bottom: 12px;
}

.auth-modal-chosen i { font-size: 14px; }

/* Category cards */
.auth-modal-cats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-modal-cat {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #e7e5e4;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-family: inherit;
}

.auth-modal-cat:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.03);
    transform: translateY(-1px);
}

.auth-modal-cat-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.auth-modal-cat-icon-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.auth-modal-cat-icon-violet { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }

.auth-modal-cat-info {
    flex: 1;
    min-width: 0;
}

.auth-modal-cat-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1c1917;
}

.auth-modal-cat-desc {
    font-size: 0.75rem;
    color: #a8a29e;
    margin-top: 1px;
}

.auth-modal-cat > i:last-child {
    color: #a8a29e;
    font-size: 12px;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.auth-modal-cat:hover > i:last-child {
    transform: translateX(3px);
    color: #10b981;
}

/* Scrollbar */
.auth-modal-card::-webkit-scrollbar { width: 4px; }
.auth-modal-card::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.12); border-radius: 2px; }
.auth-modal-card::-webkit-scrollbar-track { background: transparent; }

/* Responsive */
@media (max-width: 480px) {
    .auth-modal {
        padding: 16px;
        align-items: flex-end;
    }

    .auth-modal-card {
        border-radius: 20px 20px 0 0;
        max-height: 90vh;
        padding: 28px 20px 20px;
    }
}
