/* =====================================================================
   TestCribe — Auth Ekranları (login / signup / resetpassword /
   createnewpassword / verifycode / signupverifycode)
   login_template.xhtml tarafından admin.min.css'ten SONRA yüklenir;
   yalnızca auth sayfalarını etkiler.
   Renk paleti: .claude/skills/frontend/references/css-design-system.md
   ===================================================================== */

/* ---------- Sayfa yerleşimi ---------- */
body.login-page {
    background: #eef2f7;
}

/* admin.min.css'te body { display:flex } global tanımlı — width:100%
   olmadan .auth-page flex item olarak içerik genişliğine büzülür. */
.auth-page {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px 16px;
    background:
        radial-gradient(ellipse at 12% -8%, rgba(0, 82, 170, 0.08) 0%, rgba(0, 82, 170, 0) 55%),
        radial-gradient(ellipse at 108% 108%, rgba(1, 146, 209, 0.10) 0%, rgba(1, 146, 209, 0) 55%),
        #eef2f7;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border: 1px solid #edf2f7;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 14, 128, 0.08);
    padding: 40px 36px 28px;
}

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

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

.auth-version {
    text-align: center;
    color: #718096;
    font-size: 0.75rem;
    margin: 16px 0 0;
}

/* ---------- Başlık ---------- */
.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-title {
    color: #2d3748;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 6px;
}

.auth-subtitle {
    color: #718096;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* ---------- Form alanları ---------- */
.auth-field {
    margin-bottom: 16px;
}

.auth-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
}

.auth-label {
    display: block;
    color: #4a5568;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    text-align: left;
}

.auth-input-wrap {
    position: relative;
}

.auth-input-wrap > .fa {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #718096;
    pointer-events: none;
    z-index: 1;
}

/* admin.min.css'teki global `input { border:none }` +
   `input:focus { border-color:transparent !important }` reset'ini
   ezmek için border tanımları !important. */
.auth-card .auth-input {
    display: block;
    width: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px;
    color: #1a202c;
    height: auto;
    padding: 12px 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-input-wrap.has-icon .auth-input {
    padding-left: 42px;
}

.auth-card .auth-input:focus {
    background: #ffffff;
    border-color: #1954D1 !important;
    box-shadow: 0 0 0 3px rgba(25, 84, 209, 0.12);
}

.auth-card .auth-input.ui-state-error {
    border-color: #ef4444 !important;
}

.auth-card .auth-input::placeholder {
    color: #718096;
    opacity: 0.7;
}

/* p:password (toggleMask) sarmalayıcısı */
.auth-card .ui-password {
    display: block;
    width: 100%;
    position: relative;
}

.auth-card .ui-password .ui-password-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    cursor: pointer;
    color: #718096;
}

/* Doğrulama kodu inputu */
.auth-card .auth-code-input {
    text-align: center;
    letter-spacing: 6px;
    font-weight: 700;
}

/* ---------- Alan hata mesajları (p:message) ---------- */
.auth-card .ui-message {
    display: block;
    margin-top: 6px;
    text-align: left;
}

.auth-card .ui-message-error {
    color: #ef4444;
    font-size: 0.8rem;
}

.auth-card .ui-message-error-icon {
    display: none;
}

/* ---------- Global mesajlar (p:messages) ---------- */
.auth-card .ui-messages > div {
    position: relative;
    border: none;
    border-radius: 10px;
    padding: 12px 38px 12px 14px;
    margin: 0 0 16px;
    text-align: left;
}

.auth-card .ui-messages ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.auth-card .ui-messages-error,
.auth-card .ui-messages-fatal {
    background: #fee2e2;
    color: #991b1b;
}

.auth-card .ui-messages-info {
    background: #dbeafe;
    color: #1e40af;
}

.auth-card .ui-messages-warn {
    background: #fef3c7;
    color: #92400e;
}

.auth-card .ui-messages-error-icon,
.auth-card .ui-messages-fatal-icon,
.auth-card .ui-messages-info-icon,
.auth-card .ui-messages-warn-icon {
    display: none;
}

.auth-card .ui-messages-error-summary,
.auth-card .ui-messages-info-summary,
.auth-card .ui-messages-warn-summary {
    font-weight: 600;
}

.auth-card .ui-messages .ui-messages-close {
    position: absolute;
    right: 8px;
    top: 8px;
    color: inherit;
    text-decoration: none;
}

/* Tema CSS'i yüklü olmadığından kapatma ikonu sprite yerine metinle çizilir */
.auth-card .ui-messages .ui-messages-close .ui-icon {
    background-image: none !important;
    text-indent: 0 !important;
    overflow: visible !important;
    width: 16px;
    height: 16px;
    display: block;
    line-height: 16px;
    text-align: center;
}

.auth-card .ui-messages .ui-messages-close .ui-icon:before {
    content: "\00d7";
}

/* ---------- Statik uyarı kartları (login hata paramları) ---------- */
.auth-alert {
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 0.875rem;
    text-align: center;
}

.auth-alert:empty {
    display: none;
}

.auth-alert p {
    margin: 0;
}

.auth-alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

.auth-alert-info {
    background: #dbeafe;
    color: #1e40af;
}

.auth-alert-success {
    background: #d1fae5;
    color: #065f46;
}

/* ---------- Bilgi kutusu + sayaç (verify code) ---------- */
.auth-info {
    background: #f0f5ff;
    color: #4a5568;
    border: 1px solid #edf2f7;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 18px;
    text-align: left;
}

.auth-info .auth-timer-row {
    margin-top: 8px;
}

.auth-info .auth-timer {
    font-weight: 700;
    color: #1954D1;
}

/* ---------- Butonlar ---------- */
.auth-btn-wrap {
    margin-top: 8px;
}

.auth-card .auth-btn,
.auth-card .auth-btn.ui-state-default {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    background: linear-gradient(90deg, rgba(0, 82, 170, 1) 0%, rgba(1, 146, 209, 1) 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 10px;
    padding: 13px 20px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 82, 170, 0.25);
    transition: box-shadow 0.2s ease, transform 0.1s ease;
    text-transform: none;
}

.auth-card .auth-btn:hover,
.auth-card .auth-btn.ui-state-hover {
    box-shadow: 0 6px 18px rgba(0, 82, 170, 0.35);
}

.auth-card .auth-btn:active,
.auth-card .auth-btn.ui-state-active {
    transform: translateY(1px);
    box-shadow: 0 2px 6px rgba(0, 82, 170, 0.25);
}

.auth-card .auth-btn.ui-state-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.auth-card .auth-btn .ui-button-text {
    padding: 0;
}

/* ---------- Linkler ---------- */
.auth-links {
    margin-top: 20px;
    text-align: center;
}

.auth-links > div {
    margin-bottom: 4px;
}

.auth-links a {
    display: inline-block;
    color: #1954D1;
    font-weight: 600;
    text-decoration: none;
    padding: 4px 6px;
}

.auth-links a:hover {
    color: #1a248e;
    text-decoration: underline;
}

/* ---------- Checkbox satırı (signup gizlilik onayı) ---------- */
.auth-checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0;
    color: #4a5568;
    font-size: 0.85rem;
    line-height: 1.5;
    text-align: left;
}

.auth-checkbox-row a {
    color: #1954D1;
}

/* privacyAndPolicy i18n değeri ham HTML (link + metin) içerir; bu div
   olmadan içerik flex item'lara bölünür. */
.auth-privacy-text {
    flex: 1;
}

.auth-privacy-text a {
    color: #1954D1;
    font-weight: 600;
}

.auth-card .ui-chkbox input {
    accent-color: #1954D1;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.auth-note {
    color: #718096;
    font-size: 0.8rem;
    margin: 10px 0 4px;
    text-align: left;
}

/* ---------- Loader (üstte ince progress bar) ---------- */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    display: none;
    z-index: 9999;
    overflow: hidden;
    background: rgba(0, 82, 170, 0.12);
    margin: 0;
}

#loader .bar {
    position: absolute;
    top: 0;
    height: 100%;
    width: 35%;
    border-radius: 3px;
    background: linear-gradient(90deg, rgba(0, 82, 170, 1) 0%, rgba(1, 146, 209, 1) 100%);
    animation: auth-loading 1.4s infinite ease-in-out;
}

#loader .bar:nth-child(2) {
    animation-delay: 0.15s;
    opacity: 0.7;
}

#loader .bar:nth-child(3) {
    animation-delay: 0.3s;
    opacity: 0.4;
}

@keyframes auth-loading {
    from { left: -35%; }
    to { left: 100%; }
}

/* ---------- PF gizli-input düzeltmeleri (eski template'ten taşındı) ---------- */
.ui-outputlabel-rfi {
    display: contents;
    color: #ef4444;
}

.ui-helper-hidden-accessible {
    display: contents;
}

.ui-helper-hidden-accessible input {
    margin-right: 15px;
    margin-top: 13px;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .auth-card {
        padding: 28px 20px 20px;
        border-radius: 12px;
    }

    .auth-field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .auth-logo img {
        max-width: 160px;
    }
}
