/* ==========================================================================
   AUTHENTICATION V3 CONSOLIDATED STYLES (Login & Registration)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Roboto:wght@400;500;700&display=swap');

:root {
    --v3-navy: #1e293b;
    --v3-teal: #083b4f;
    --v3-white: #ffffff;
    --v3-gray-light: #fcfcfd;
    --v3-gray-medium: #e2e8f0;
    --v3-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
    --v3-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body.auth-v3-full-page {
    background-color: #f8f9fb !important;
    font-family: 'Nunito', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.auth-v3-full-page .main {
    flex: 1;
    display: flex;
}

/* --- HIDE GLOBAL ELEMENTS --- */
body.auth-v3-full-page .preloader,
body.auth-v3-full-page .scroll-top {
    display: none !important;
}

/* --- FULL PAGE BACKGROUND --- */
.auth-v3-full-page-wrapper {
    flex: 1;
    min-height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px;
    background-color: #f8f9fb;
    /* Neat & Clean off-white */
    position: relative;
    overflow: hidden;
}

/* --- STREAMLINED HERO / BREADCRUMB --- */
.auth-hero-v3 {
    background: linear-gradient(135deg, var(--v3-navy), #2c5e74);
    padding: 40px 0;
    position: relative;
    overflow: hidden;
}

.auth-hero-v3::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(76, 171, 184, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

.auth-hero-content {
    position: relative;
    z-index: 2;
}

.auth-hero-title {
    color: #fff;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 5px;
}

.auth-breadcrumb {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.auth-breadcrumb li {
    color: rgba(255, 255, 255, 0.6);
}

.auth-breadcrumb li a {
    color: var(--v3-teal);
    text-decoration: none;
    transition: 0.3s;
}

.auth-breadcrumb li a:hover {
    color: #fff;
}

.auth-breadcrumb-chevron {
    font-size: 0.7rem;
    opacity: 0.5;
}

/* --- AUTH MAIN SECTION --- */
.auth-main-section {
    padding: 20px 0;
}

.auth-glass-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: var(--v3-shadow);
    border: 1px solid #f1f5f9;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
    max-width: 560px;
    /* Default for Login/Recover */
    width: 100%;
    margin: 0 auto;
}

.auth-glass-card.v3-register-card {
    max-width: 600px;
}

.auth-card-centered {
    max-width: 480px;
}

.auth-logo-center {
    display: none;
}

.auth-logo-center img:hover {
    transform: scale(1.05);
}

/* --- SIDE LAYOUTS --- */
.auth-form-side {
    padding: 2rem 1.75rem;
    background: #fff;
    flex: 1;
    min-width: 100%;
}

.auth-image-side {
    flex: 0.8;
    min-width: 380px;
    background: #f8fafc;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

/* --- HEADERS --- */
.auth-form-header {
    margin-bottom: 10px;
}

.auth-form-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--v3-navy);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-form-header p {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 0;
    font-weight: 500;
}

.text-teal {
    color: var(--v3-teal) !important;
}

/* --- NEAT & CLEAN FORM CONTROLS --- */
.v3-form-group {
    position: relative;
    margin-bottom: 0.78rem;
}

.v3-form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 800;
    color: #64748b;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.v3-input-wrapper {
    position: relative;
    width: 100%;
}

.v3-form-control {
    width: 100%;
    height: 44px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1e293b;
    transition: var(--v3-transition);
    outline: none !important;
}

.v3-form-control::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.v3-form-control:focus {
    border-color: var(--v3-teal);
    box-shadow: 0 0 0 1px var(--v3-teal);
}

.v3-field-note {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    padding: 3px 7px;
    background: #ecfeff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    color: #0f5f6b;
    font-size: 0.71rem;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.v3-field-note i {
    flex: 0 0 auto;
    color: #0d9488;
    font-size: 0.72rem;
    line-height: 1;
}

/* No Icon Standard */
.v3-form-control.no-icon {
    padding-left: 16px;
}

/* Select Styling */
.v3-select-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 15px;
    padding-right: 35px;
}

/* --- CAPTCHA GROUP --- */
.captcha-container-v3 {
    background: #f8fafc;
    padding: 5px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
    border: 1.5px solid #edf2f7;
}

.v3-captcha-img {
    height: 40px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.v3-refresh-btn {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    border: none;
    background: #fff;
    color: var(--v3-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.v3-refresh-btn:hover {
    background: var(--v3-teal);
    color: #fff;
    transform: rotate(180deg);
}

.v3-captcha-input {
    padding-left: 15px !important;
    border-radius: 8px !important;
    height: 44px !important;
    /* Match other inputs */
}

/* --- BUTTONS & LINKS --- */
.v3-auth-btn {
    width: 100%;
    background: var(--v3-navy);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: var(--v3-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 1rem;
}

.v3-auth-btn:hover {
    background: var(--v3-teal);
    transform: translateY(-1px);
}

.auth-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    gap: 12px;
}

.auth-link-v3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--v3-teal);
    text-decoration: none;
    transition: 0.3s;
}

.auth-link-v3:hover {
    color: var(--v3-navy);
    text-decoration: underline;
}

.auth-field-action {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
    min-height: 18px;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 700;
}

.auth-inline-link {
    background: transparent;
    border: 0;
    color: var(--v3-teal);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    font: inherit;
    font-weight: 800;
    margin: 0;
    padding: 0;
    text-decoration: none;
}

.auth-inline-link:hover {
    color: var(--v3-navy);
    text-decoration: underline;
}

.auth-prompt-v3 {
    margin-top: 14px;
    text-align: center;
    font-size: 0.9rem;
    color: #64748b;
}

.auth-prompt-link-v3 {
    color: var(--v3-navy);
    font-weight: 800;
    text-decoration: none;
    border-bottom: 2px solid var(--v3-teal);
    transition: 0.3s;
}

.auth-prompt-link-v3:hover {
    color: var(--v3-teal);
}

.auth-alt-action {
    margin: -6px 0 10px;
    text-align: center;
}

.auth-otp-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 8px;
    background: var(--v3-teal);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(8, 59, 79, 0.16);
    font-size: 0.78rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition: var(--v3-transition);
}

.auth-otp-link i {
    font-size: 0.7rem;
}

.auth-otp-link:hover {
    background: var(--v3-navy);
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
}

.auth-secondary-btn {
    width: 100%;
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #f8fbff;
    color: var(--v3-navy);
    text-decoration: none;
    transition: var(--v3-transition);
}

.auth-secondary-btn:hover {
    border-color: #b6d4fe;
    background: #eef6ff;
    color: var(--v3-navy);
    text-decoration: none;
    transform: translateY(-1px);
}

.auth-secondary-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #ffffff;
    color: var(--v3-teal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    box-shadow: inset 0 0 0 1px #e2e8f0;
}

.auth-secondary-copy {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    line-height: 1.15;
}

.auth-secondary-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--v3-navy);
}

.auth-secondary-note {
    margin-top: 3px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
}

.auth-secondary-arrow {
    color: #64748b;
    font-size: 0.82rem;
}

.otp-session-modal .modal-content {
    border: 0;
    border-radius: 10px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

.otp-session-modal .modal-header {
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 18px;
}

.otp-session-modal .modal-body {
    padding: 18px;
}

.otp-session-modal .modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 14px 18px;
}

.otp-session-icon {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #fff7ed;
    color: #c2410c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 1rem;
}

.otp-session-title {
    color: var(--v3-navy);
    font-size: 1rem;
    font-weight: 800;
    margin: 0;
}

.otp-session-copy {
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.45;
    margin: 0;
}

.otp-modal-btn {
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 10px 14px;
}

.otp-modal-btn-primary {
    background: var(--v3-navy);
    border-color: var(--v3-navy);
    color: #ffffff;
}

.otp-modal-btn-primary:hover {
    background: var(--v3-teal);
    border-color: var(--v3-teal);
    color: #ffffff;
}

.otp-modal-btn-muted {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #334155;
}

.otp-modal-btn-muted:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.reset-account-summary {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
}

.reset-account-name {
    color: var(--v3-navy);
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.3;
}

.reset-account-email {
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

/* --- IMAGE SIDE ELEMENTS --- */
.auth-side-image-wrapper {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.auth-side-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s ease;
}

.auth-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(26, 67, 84, 0.8));
    display: flex;
    align-items: flex-end;
    padding: 30px;
}

.auth-overlay-text {
    color: #fff;
}

.auth-overlay-text h4 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-overlay-text p {
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.5;
    margin: 0;
}

/* --- ALERTS --- */
.v3-alert {
    background: #fff5f5;
    color: #c53030;
    border: none;
    border-radius: 16px;
    padding: 15px 20px;
    font-size: 0.9rem;
    box-shadow: inset 0 0 0 1px rgba(197, 48, 48, 0.1);
}

.v3-alert ul {
    padding-left: 20px;
    margin: 0;
}

/* --- RESPONSIVE --- */
@media (max-width: 991px) {
    .auth-image-side {
        display: none;
    }

    .auth-form-side {
        padding: 28px 20px;
    }

    .auth-glass-card {
        min-height: auto;
        border-radius: 16px;
    }

    .auth-main-section {
        padding: 40px 0;
    }
}

@media (max-width: 576px) {
    .auth-hero-title {
        font-size: 1.8rem;
    }

    .auth-form-header h2 {
        font-size: 1.5rem;
    }

    .v3-auth-btn {
        padding: 12px;
        font-size: 0.84rem;
    }
}

/* ==========================================================================
   OAuth Login Styling
   ========================================================================== */

.oauth-divider {
    display: flex;
    align-items: center;
    margin: 10px 0 10px;
    font-size: 0.78rem;
    color: var(--v3-muted, #94a3b8);
    font-weight: 600;
}

.oauth-divider::before,
.oauth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #cbd5e1, transparent);
}

.oauth-divider span {
    padding: 0 12px;
    background: #fff;
}

.oauth-divider-bottom {
    display: flex;
    align-items: center;
    margin: 12px 0 12px;
    font-size: 0.78rem;
    color: var(--v3-muted, #94a3b8);
    font-weight: 600;
}

.oauth-divider-bottom::before,
.oauth-divider-bottom::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #cbd5e1, transparent);
}

.oauth-divider-bottom span {
    padding: 0 12px;
    background: #fff;
}

.oauth-buttons-container {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
    flex-wrap: nowrap;
}

.oauth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    padding: 7px 9px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: #ffffff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.78rem;
    color: #1e293b;
    transition: all 0.25s ease;
    font-family: "Nunito", sans-serif;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.07);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.oauth-btn::after {
    content: '';
    position: absolute;
    right: -28px;
    bottom: -58px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    pointer-events: none;
}

.oauth-btn:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

.oauth-btn:focus-visible {
    outline: 3px solid rgba(8, 59, 79, 0.18);
    outline-offset: 3px;
}

.oauth-logo {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.oauth-logo svg {
    width: 18px;
    height: 18px;
}

.oauth-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
}

.oauth-kicker {
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 800;
    opacity: 0.72;
    margin-bottom: 3px;
}

.oauth-logo-orcid svg,
.oauth-logo-linkedin svg {
    width: 19px;
    height: 19px;
}

.oauth-label {
    font-size: 0.78rem;
    letter-spacing: 0.01em;
}

/* Google Styling */
.oauth-google {
    background: linear-gradient(135deg, #ffffff 0%, #f6f9ff 100%);
    border-color: #d9e2f1;
}

.oauth-google:hover {
    background: linear-gradient(135deg, #ffffff 0%, #eef5ff 100%);
    box-shadow: 0 16px 30px rgba(66, 133, 244, 0.15);
}

.oauth-google .oauth-logo {
    background: #ffffff;
    box-shadow: inset 0 0 0 1px #e5e7eb;
}

.oauth-google .oauth-kicker {
    color: #5f6368;
}

.oauth-google .oauth-label {
    color: #202124;
}

/* ORCID Styling */
.oauth-orcid {
    background: linear-gradient(135deg, #c2e85e 0%, #8bcf30 100%);
    border-color: #7ebc28;
    color: #163300;
}

.oauth-orcid:hover {
    background: linear-gradient(135deg, #c9ee67 0%, #82c32c 100%);
    box-shadow: 0 16px 30px rgba(126, 188, 40, 0.28);
}

.oauth-orcid .oauth-logo {
    color: #a6ce39;
    background: #ffffff;
}

.oauth-orcid .oauth-kicker,
.oauth-orcid .oauth-label {
    color: #163300;
}

/* LinkedIn Styling */
.oauth-linkedin {
    background: linear-gradient(135deg, #0a66c2 0%, #004182 100%);
    border-color: #004182;
    color: #ffffff;
}

.oauth-linkedin:hover {
    background: linear-gradient(135deg, #0b6fd6 0%, #003a75 100%);
    box-shadow: 0 16px 30px rgba(10, 102, 194, 0.28);
}

.oauth-linkedin .oauth-logo {
    color: #0a66c2;
    background: #ffffff;
}

.oauth-linkedin .oauth-kicker,
.oauth-linkedin .oauth-label {
    color: #ffffff;
}

/* Mobile Responsive - OAuth */
@media (max-width: 576px) {
    .oauth-buttons-container {
        flex-direction: row;
        gap: 8px;
    }

    .oauth-btn {
        padding: 7px 8px;
        gap: 5px;
    }

    .oauth-logo {
        width: 28px;
        height: 28px;
        border-radius: 6px;
    }

    .oauth-logo svg {
        width: 17px;
        height: 17px;
    }

    .oauth-kicker {
        font-size: 0.65rem;
    }

    .oauth-label {
        font-size: 0.74rem;
    }
}
