/* ── Field validation states ── */
.field-error {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.12) !important;
}

.field-error-msg {
    display: block;
    font-size: 12px;
    color: #e74c3c;
    margin-top: 5px;
    padding-left: 2px;
    animation: fadeInDown 0.2s ease;
}

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

/* ── Password toggle wrapper ── */
.password-wrapper {
    position: relative;
}

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

.pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    transition: color 0.2s;
}

.pw-toggle:hover {
    color: #088178;
}

/* eye icon SVG paths animate opacity */
.pw-toggle .eye-open,
.pw-toggle .eye-closed {
    position: absolute;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.pw-toggle .eye-closed {
    opacity: 0;
    transform: scale(0.7);
}

/* when password is visible */
.pw-toggle.is-visible .eye-open {
    opacity: 0;
    transform: scale(0.7);
}

.pw-toggle.is-visible .eye-closed {
    opacity: 1;
    transform: scale(1);
}

/* ── Field entrance stagger (moved from inline) ── */
@keyframes fieldSlideIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form-panel .form-group,
.auth-form-panel .heading_s1,
.auth-form-panel .subtitle {
    opacity: 0;
}

.auth-form-panel.animate .form-group,
.auth-form-panel.animate .heading_s1,
.auth-form-panel.animate .subtitle {
    animation: fieldSlideIn 0.35s ease forwards;
}

.auth-form-panel.animate .heading_s1          { animation-delay: 0ms; }
.auth-form-panel.animate .subtitle            { animation-delay: 60ms; }
.auth-form-panel.animate .form-group:nth-child(1) { animation-delay: 120ms; }
.auth-form-panel.animate .form-group:nth-child(2) { animation-delay: 200ms; }
.auth-form-panel.animate .form-group:nth-child(3) { animation-delay: 280ms; }
.auth-form-panel.animate .form-group:nth-child(4) { animation-delay: 360ms; }
.auth-form-panel.animate .form-group:nth-child(5) { animation-delay: 440ms; }
.auth-form-panel.animate .form-group:nth-child(6) { animation-delay: 520ms; }

/* ── Auth layout ── */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 15px;
}

.auth-container {
    width: 100%;
    max-width: 860px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.10);
    background: #fff;
    border: 1px solid #e2e9e1;
    display: flex;
    align-items: stretch;
}

.auth-forms-area {
    flex: 1;
    min-width: 0;
}

.auth-form-panel {
    width: 100%;
    padding: 50px 45px 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fff;
    box-sizing: border-box;
}

.auth-form-panel.hidden {
    display: none;
}

.auth-form-panel h3 {
    font-size: 22px;
    font-weight: 700;
    color: #253d4e;
    margin-bottom: 6px;
}

.auth-form-panel .subtitle {
    font-size: 13px;
    color: #aaa;
    margin-bottom: 26px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"] {
    background: #f8f9fa;
    border: 1px solid #e2e9e1;
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    border-color: #088178 !important;
    box-shadow: 0 0 0 3px rgba(8,129,120,0.10) !important;
    background: #fff;
    outline: none;
}

/* ── Green side panel ── */
.auth-side-panel {
    width: 300px;
    flex-shrink: 0;
    background: #088178;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.auth-side-panel::before {
    content: '';
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    top: -80px;
    right: -80px;
}

.auth-side-panel::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    bottom: -60px;
    left: -60px;
}

.side-icon {
    font-size: 52px;
    color: rgba(255,255,255,0.9);
    margin-bottom: 22px;
    transition: transform 0.4s ease;
}

.auth-side-panel h4 {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    line-height: 1.3;
}

.auth-side-panel p {
    font-size: 13px;
    color: rgba(255,255,255,0.80);
    margin-bottom: 32px;
    line-height: 1.7;
}

.side-switch-label {
    font-size: 12px;
    color: rgba(255,255,255,0.65);
    margin-bottom: 10px;
    display: block;
}

.btn-switch {
    display: inline-block;
    padding: 11px 30px;
    border: 2px solid rgba(255,255,255,0.85);
    border-radius: 5px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    background: transparent;
    cursor: pointer;
    transition: background 0.25s, color 0.25s, transform 0.2s;
    text-decoration: none;
}

.btn-switch:hover {
    background: #fff;
    color: #088178;
    transform: scale(1.04);
    text-decoration: none;
}

/* ── Phone input row ── */
.phone-group .phone-row {
    display: flex;
    gap: 8px;
}

.phone-prefix-wrap {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #e2e9e1;
    border-radius: 6px;
    padding: 0 10px 0 12px;
    flex-shrink: 0;
    width: 80px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.phone-prefix-wrap:focus-within {
    border-color: #088178;
    box-shadow: 0 0 0 3px rgba(8,129,120,0.10);
    background: #fff;
}

.phone-plus {
    color: #aaa;
    font-size: 14px;
    margin-right: 4px;
    user-select: none;
}

.phone-prefix-wrap input,
.phone-prefix-wrap input:focus {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
    width: 100%;
    font-size: 14px;
}

.phone-group .phone-row > .password-wrapper,
.phone-group .phone-row > input {
    flex: 1;
}

/* ── Register success state ── */
.register-success-msg {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px 0;
    gap: 12px;
}

.register-success-msg i {
    font-size: 48px;
    color: #088178;
}

.register-success-msg h4 {
    font-size: 20px;
    font-weight: 700;
    color: #253d4e;
    margin: 0;
}

.register-success-msg p {
    font-size: 14px;
    color: #888;
    margin: 0;
    line-height: 1.6;
}

/* ── Auth login error ── */
.auth-login-error {
    background: #fff5f5;
    border: 1px solid #ffd7d7;
    border-radius: 6px;
    color: #c0392b;
    font-size: 13px;
    padding: 10px 14px;
    margin-bottom: 16px;
}

/* ── Button loading spinner ── */
.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

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

/* ── Mobile tabs ── */
.mobile-tabs {
    display: none;
}

.mobile-tab {
    flex: 1;
    padding: 13px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #aaa;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -2px;
}

.mobile-tab.active {
    color: #088178;
    border-bottom-color: #088178;
}

/* ── Responsive ── */
@media (max-width: 767px) {
    .auth-side-panel { display: none; }

    .auth-container {
        display: block;
    }

    .auth-form-panel {
        padding: 30px 20px 36px;
        justify-content: flex-start;
    }

    #registerPanel {
        padding-top: 40px;
    }

    .mobile-tabs {
        display: flex !important;
        border-bottom: 2px solid #e2e9e1;
    }
}
