﻿/* ============================================================
   Auth.css — TachoOnline Auth pages
   ============================================================ */

/* ---- Reset / Base ---------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(145deg, #eaf0fb 0%, #dce7f7 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    color: #1e2a3a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ---- Page wrapper ---------------------------------------- */
.auth-page {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}

/* Give the ASP.NET form element a fixed width so all pages
   share the same card width regardless of their content */
.auth-page > form {
    width: 100%;
    max-width: 420px;
}

/* ---- Brand / Logo ---------------------------------------- */
.auth-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    width: 100%;
    max-width: 420px;
}

.auth-brand img {
    height: 48px;
    width: auto;
    display: block;
}

/* ---- Card / form wrapper --------------------------------- */
.auth-form-wrapper {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 32px rgba(26, 109, 181, 0.10), 0 1px 4px rgba(0,0,0,0.06);
    padding: 36px 40px 32px;
    width: 100%;
}

.auth-form-wrapper h3 {
    margin: 0 0 24px;
    font-size: 20px;
    font-weight: 700;
    color: #1e2a3a;
    text-align: center;
}

/* ---- Fields ---------------------------------------------- */
.auth-field {
    margin-bottom: 14px;
}

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

.auth-field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #7a95ab;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.auth-field input[type="text"],
.auth-field input[type="password"] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #d1dbe8;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #1e2a3a;
    background: #fff;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-field input[type="text"]:focus,
.auth-field input[type="password"]:focus {
    border-color: #1a6db5;
    box-shadow: 0 0 0 3px rgba(26, 109, 181, 0.12);
}

.auth-field input[type="text"]::placeholder,
.auth-field input[type="password"]::placeholder {
    color: #9aabb8;
}

/* ---- Error / status messages ----------------------------- */
.error-msg {
    display: block;
    color: #c0392b;
    font-size: 12px;
    margin-top: 3px;
    min-height: 16px;
}

.ok-msg {
    display: block;
    color: #27ae60;
    font-size: 13px;
    padding: 8px 12px;
    background: #eafaf1;
    border-radius: 6px;
    border-left: 3px solid #27ae60;
}

.info-msg {
    display: block;
    color: #1a6db5;
    font-size: 13px;
    min-height: 16px;
}

.error-add-border-warning {
    border-color: #c0392b !important;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.10) !important;
}

.input-ok {
    border-color: #27ae60 !important;
}

.input-error-red {
    border-color: #c0392b !important;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.10) !important;
}

/* ---- Primary button -------------------------------------- */
.auth-btn,
button.auth-btn {
    display: block;
    width: 100%;
    padding: 11px 16px;
    margin-top: 14px;
    background: #1a6db5;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    text-align: center;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: 0.2px;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    user-select: none;
}

.auth-btn:hover,
button.auth-btn:hover {
    background: #155ea0;
    box-shadow: 0 4px 12px rgba(26, 109, 181, 0.28);
}

.auth-btn:active,
button.auth-btn:active {
    transform: scale(0.99);
    box-shadow: none;
}

/* ---- Footer links --------------------------------------- */
.auth-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: #5a7290;
    line-height: 1.7;
}

.auth-footer p {
    margin: 4px 0;
}

.auth-footer a {
    color: #1a6db5;
    text-decoration: none;
    font-weight: 500;
}

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

/* ---- GDPR / links list ---------------------------------- */
.auth-links {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
    font-size: 12px;
    color: #8096aa;
    text-align: center;
    line-height: 2;
}

.auth-links li {
    display: inline;
}

.auth-links li + li::before {
    content: ' · ';
    color: #c5d0da;
}

.auth-links a {
    color: #7a97b0;
    text-decoration: none;
}

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

/* ---- Password strength bar ------------------------------ */
.progress {
    width: 100%;
    height: 5px;
    background: #e8edf2;
    border-radius: 99px;
    margin: 4px 0 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    border-radius: 99px;
    transition: width 0.3s ease, background 0.3s ease;
}

.progress-bar-danger  { background: #c0392b; }
.progress-bar-warning { background: #f39c12; }
.progress-bar-success { background: #27ae60; }

/* ---- Radio buttons (2FA selection) --------------------- */
.auth-radio {
    margin-bottom: 8px;
}

.auth-radio label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1.5px solid #d1dbe8;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-size: 13px;
    color: #1e2a3a;
}

.auth-radio label:hover {
    border-color: #1a6db5;
    background: #f0f6fd;
}

.auth-radio input[type="radio"] {
    accent-color: #1a6db5;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}

.auth-radio input[type="radio"]:checked + .auth-radio label,
.auth-radio label:has(input[type="radio"]:checked) {
    border-color: #1a6db5;
    background: #eef5fd;
}

/* ---- 2FA code inputs ------------------------------------ */
.number-code {
    border: none;
    padding: 0;
    margin: 18px 0;
}

.number-code legend {
    font-size: 13px;
    font-weight: 600;
    color: #5a7290;
    margin-bottom: 12px;
    padding: 0;
}

.code-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
}

input.code-input {
    width: 48px;
    height: 56px;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    border: 2px solid #d1dbe8;
    border-radius: 8px;
    background: #f8fafc;
    color: #1e2a3a;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    padding: 0;
    flex: 1;
    min-width: 0;
    max-width: 56px;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

input.code-input::-webkit-outer-spin-button,
input.code-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input.code-input:focus {
    border-color: #1a6db5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26, 109, 181, 0.15);
}

input.code-input:not(:placeholder-shown) {
    background: #fff;
    border-color: #1a6db5;
}

/* ---- Login / Verify buttons (with spinner) -------------- */
#TachoOnlineLoginBtn,
#VerifyCodeBtn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

#TachoOnlineLoginBtn:not(.loading) .verify-spinner,
#VerifyCodeBtn:not(.loading) .verify-spinner {
    display: none;
}

#TachoOnlineLoginBtn:not(.loading) span,
#VerifyCodeBtn:not(.loading) span {
    display: inline-block;
}

#TachoOnlineLoginBtn.loading .verify-spinner,
#VerifyCodeBtn.loading .verify-spinner {
    display: inline-block;
    font-size: 16px;
}

#TachoOnlineLoginBtn.loading span,
#VerifyCodeBtn.loading span {
    display: none;
}

#CompanySearch:disabled {
    border: none;
}

/* ---- jQuery UI autocomplete ----------------------------- */
.ui-autocomplete {
    border: 1.5px solid #d1dbe8 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(26,109,181,0.10) !important;
    font-family: inherit !important;
    font-size: 13px !important;
    overflow: hidden;
}

.ui-menu-item-wrapper {
    padding: 8px 14px !important;
    color: #1e2a3a !important;
}

.ui-state-active,
.ui-menu-item-wrapper.ui-state-active {
    background: #eef5fd !important;
    border-color: transparent !important;
    color: #1a6db5 !important;
}

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

    input.code-input {
        height: 48px;
        font-size: 18px;
    }
}
