/*
 * GTheme Premium Authentication UI
 * OJS 3.3.x — Login and Registration
 *
 * Login/Register are rendered inside the same global public shell as all
 * journal pages. This stylesheet only skins authentication content; header,
 * hero, sidebar and footer remain owned by the global GTheme layout.
 */

.gtheme-auth-page {
    --auth-border: rgba(15, 23, 42, .09);
    --auth-muted: #64748b;
    --auth-text: #0f172a;
    width: 100%;
}

.gtheme-auth-frame {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--auth-border);
    border-radius: 24px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .08);
}

.gtheme-auth-frame::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gtheme-dark), var(--gtheme-mid), var(--gtheme-accent));
}

.gtheme-auth-login-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.22fr) minmax(280px, .78fr);
    min-height: 590px;
}

.gtheme-auth-main {
    padding: clamp(34px, 5vw, 58px);
}

.gtheme-auth-aside {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px 38px;
    color: #fff;
    background:
        radial-gradient(circle at 110% -5%, rgba(255,255,255,.18), transparent 34%),
        linear-gradient(145deg, var(--gtheme-dark), color-mix(in srgb, var(--gtheme-dark) 68%, var(--gtheme-mid)));
}

.gtheme-auth-aside::after {
    content: "";
    position: absolute;
    width: 300px;
    height: 300px;
    right: -190px;
    bottom: -180px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.12);
    box-shadow: 0 0 0 48px rgba(255,255,255,.025), 0 0 0 96px rgba(255,255,255,.018);
}

.gtheme-auth-aside > * { position: relative; z-index: 1; }

.gtheme-auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--gtheme-mid);
    font-size: 10px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.gtheme-auth-eyebrow::before {
    content: "";
    width: 24px;
    height: 1px;
    background: currentColor;
}

.gtheme-auth-heading {
    margin: 0;
    color: var(--auth-text) !important;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(30px, 3.2vw, 42px);
    line-height: 1.05;
    letter-spacing: -.025em;
    font-weight: 400 !important;
}

.gtheme-auth-intro {
    max-width: 640px;
    margin: 14px 0 0;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.7;
}

.gtheme-auth-form {
    margin-top: 34px;
}

.gtheme-auth-form .gtheme-auth-field,
.gtheme-auth-form .fields > div {
    min-width: 0;
}

.gtheme-auth-form label {
    color: #334155 !important;
    font-weight: 650 !important;
}

.gtheme-auth-form input[type="text"],
.gtheme-auth-form input[type="email"],
.gtheme-auth-form input[type="password"],
.gtheme-auth-form input[type="url"],
.gtheme-auth-form textarea,
.gtheme-auth-form select {
    width: 100%;
    min-height: 48px;
    margin-top: 8px !important;
    border: 1px solid #dbe3ec !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #0f172a !important;
    box-shadow: 0 1px 2px rgba(15,23,42,.025) !important;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease !important;
}

.gtheme-auth-form input[type="text"]:focus,
.gtheme-auth-form input[type="email"]:focus,
.gtheme-auth-form input[type="password"]:focus,
.gtheme-auth-form input[type="url"]:focus,
.gtheme-auth-form textarea:focus,
.gtheme-auth-form select:focus {
    outline: none !important;
    border-color: var(--gtheme-mid) !important;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--gtheme-accent) 46%, transparent) !important;
}

.gtheme-auth-form input::placeholder,
.gtheme-auth-form textarea::placeholder { color: #94a3b8; }

.gtheme-auth-form input[type="checkbox"] {
    width: 17px;
    height: 17px;
    border-radius: 5px !important;
    accent-color: var(--gtheme-mid);
}

.gtheme-auth-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
}

.gtheme-auth-meta label { margin: 0; }

.gtheme-auth-link,
.gtheme-auth-page a.gtheme-auth-link {
    color: var(--gtheme-mid) !important;
    font-weight: 700;
    text-decoration: none !important;
}

.gtheme-auth-link:hover,
.gtheme-auth-page a.gtheme-auth-link:hover { color: var(--gtheme-dark) !important; }

.gtheme-auth-submit,
.gtheme-auth-form .gtheme-auth-submit {
    width: 100%;
    min-height: 50px;
    margin-top: 26px;
    border: 0 !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, var(--gtheme-dark), var(--gtheme-mid)) !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    box-shadow: 0 12px 26px color-mix(in srgb, var(--gtheme-dark) 22%, transparent) !important;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease !important;
}

.gtheme-auth-submit:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: 0 16px 34px color-mix(in srgb, var(--gtheme-dark) 28%, transparent) !important;
}

.gtheme-auth-switch {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid #edf1f5;
    color: var(--auth-muted);
    font-size: 13px;
    text-align: center;
}

.gtheme-auth-aside__label {
    display: block;
    margin-bottom: 12px;
    color: var(--gtheme-accent);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .17em;
    text-transform: uppercase;
}

.gtheme-auth-aside h3 {
    max-width: 300px;
    margin: 0;
    color: #fff !important;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 30px;
    line-height: 1.1;
    font-weight: 400 !important;
}

.gtheme-auth-aside p {
    margin: 16px 0 0;
    color: rgba(255,255,255,.72);
    font-size: 13px;
    line-height: 1.7;
}

.gtheme-auth-benefits {
    display: grid;
    gap: 12px;
    margin: 34px 0 0;
    padding: 0;
    list-style: none;
}

.gtheme-auth-benefits li {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    align-items: start;
    color: rgba(255,255,255,.85);
    font-size: 12px;
    line-height: 1.55;
}

.gtheme-auth-benefits__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 8px;
    background: rgba(255,255,255,.07);
    color: var(--gtheme-accent);
    font-size: 12px;
    font-weight: 900;
}

.gtheme-auth-aside__foot {
    margin-top: 38px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,.12);
    color: rgba(255,255,255,.56);
    font-size: 11px;
    line-height: 1.6;
}

/* Alerts */
.gtheme-auth-alert {
    margin: 24px 0 0;
    padding: 13px 15px;
    border-radius: 11px;
    font-size: 13px;
    line-height: 1.55;
}
.gtheme-auth-alert--success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.gtheme-auth-alert--error { background: #fff1f2; color: #9f1239; border: 1px solid #fecdd3; }

/* Register */
.gtheme-register-card { padding: clamp(30px, 4.5vw, 54px); }
.gtheme-register-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 34px;
    padding-bottom: 26px;
    border-bottom: 1px solid #edf1f5;
}
.gtheme-register-head__copy { max-width: 680px; }
.gtheme-register-head__hint {
    flex: 0 0 auto;
    padding: 10px 13px;
    border-radius: 10px;
    background: var(--gtheme-soft);
    color: var(--gtheme-dark);
    font-size: 11px;
    font-weight: 750;
}

.gtheme-register-form fieldset {
    position: relative;
    margin: 0 0 24px !important;
    padding: 26px !important;
    border: 1px solid #e5ebf1 !important;
    border-radius: 16px !important;
    background: #fff;
}

.gtheme-register-form fieldset > legend {
    width: auto;
    margin: 0;
    padding: 0 10px;
    color: var(--gtheme-dark) !important;
    background: #fff;
    font-size: 11px !important;
    line-height: 1;
    font-weight: 850 !important;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.gtheme-register-form fieldset.identity,
.gtheme-register-form fieldset.login {
    background: linear-gradient(180deg, #fff, #fbfdff);
}

.gtheme-register-form fieldset .fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 22px;
}

.gtheme-register-form fieldset.consent .fields,
.gtheme-register-form fieldset.reviewer .fields,
.gtheme-register-form fieldset:not(.identity):not(.login) .fields {
    grid-template-columns: 1fr;
}

.gtheme-register-form .reviewer {
    background: var(--gtheme-soft) !important;
    border-color: color-mix(in srgb, var(--gtheme-accent) 62%, #e5e7eb) !important;
}

.gtheme-register-form .required { color: #dc2626; }
.gtheme-register-form .buttons-action { margin-top: 8px; }
.gtheme-register-form .recaptcha_wrapper,
.gtheme-auth-form .recaptcha_wrapper { display: flex; justify-content: center; margin: 22px 0 0; overflow: auto; }

/* OJS form errors inside the premium card */
.gtheme-auth-page .pkp_form_error,
.gtheme-auth-page .cmp_form .pkp_form_error,
.gtheme-auth-page .error {
    border-radius: 10px;
}

/* Dark mode */
html.dark .gtheme-auth-page {
    --auth-border: rgba(255,255,255,.09);
    --auth-muted: #94a3b8;
    --auth-text: #f8fafc;
}
html.dark .gtheme-auth-frame { background: #111827; box-shadow: 0 24px 70px rgba(0,0,0,.28); }
html.dark .gtheme-auth-heading { color: #f8fafc !important; }
html.dark .gtheme-auth-form label { color: #cbd5e1 !important; }
html.dark .gtheme-auth-form input[type="text"],
html.dark .gtheme-auth-form input[type="email"],
html.dark .gtheme-auth-form input[type="password"],
html.dark .gtheme-auth-form input[type="url"],
html.dark .gtheme-auth-form textarea,
html.dark .gtheme-auth-form select {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
}
html.dark .gtheme-auth-switch,
html.dark .gtheme-register-head { border-color: rgba(255,255,255,.08); }
html.dark .gtheme-register-form fieldset,
html.dark .gtheme-register-form fieldset.identity,
html.dark .gtheme-register-form fieldset.login {
    background: #111827 !important;
    border-color: #334155 !important;
}
html.dark .gtheme-register-form fieldset > legend { background: #111827; color: var(--gtheme-accent) !important; }
html.dark .gtheme-register-form .reviewer { background: rgba(255,255,255,.035) !important; }
html.dark .gtheme-register-head__hint { background: rgba(255,255,255,.06); color: var(--gtheme-accent); }
html.dark .gtheme-auth-alert--success { background: rgba(22,101,52,.18); color: #bbf7d0; border-color: rgba(187,247,208,.18); }
html.dark .gtheme-auth-alert--error { background: rgba(159,18,57,.16); color: #fecdd3; border-color: rgba(254,205,211,.18); }

@media (max-width: 900px) {
    .gtheme-auth-login-grid { grid-template-columns: 1fr; min-height: 0; }
    .gtheme-auth-aside { min-height: 340px; }
    .gtheme-register-head { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 680px) {
    .gtheme-auth-frame { border-radius: 18px; }
    .gtheme-auth-main, .gtheme-register-card { padding: 28px 20px; }
    .gtheme-auth-aside { padding: 32px 24px; }
    .gtheme-auth-meta { align-items: flex-start; flex-direction: column; gap: 12px; }
    .gtheme-register-form fieldset { padding: 22px 18px !important; }
    .gtheme-register-form fieldset .fields { grid-template-columns: 1fr; }
}

/* Password recovery and registration-complete states */
.gtheme-auth-single { max-width: 760px; margin: 0 auto; }
.gtheme-auth-single .gtheme-auth-main { padding: clamp(34px, 5vw, 56px); }
.gtheme-auth-actions-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 30px 0 0 !important;
    padding: 0 !important;
    list-style: none !important;
}
.gtheme-auth-actions-list li { margin: 0 !important; padding: 0 !important; }
.gtheme-auth-actions-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 0 15px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #334155 !important;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.gtheme-auth-actions-list a::after { content: "›"; color: var(--gtheme-mid); font-size: 18px; }
.gtheme-auth-actions-list a:hover { transform: translateY(-1px); border-color: var(--gtheme-accent); background: var(--gtheme-soft); color: var(--gtheme-dark) !important; }
html.dark .gtheme-auth-actions-list a { background: #0f172a; border-color: #334155; color: #e2e8f0 !important; }
html.dark .gtheme-auth-actions-list a:hover { background: rgba(255,255,255,.045); color: #fff !important; }
@media(max-width:680px){.gtheme-auth-actions-list{grid-template-columns:1fr;}}

/* Keep site-wide registration context selectors compact when they appear. */
.gtheme-register-form fieldset fieldset {
    margin: 16px 0 0 !important;
    padding: 18px !important;
    border-radius: 12px !important;
    background: transparent !important;
}
.gtheme-register-form .contexts { margin: 0 !important; padding: 0 !important; list-style: none !important; }
.gtheme-register-form .contexts > .context { padding: 18px 0; border-bottom: 1px solid #edf1f5; }
.gtheme-register-form .contexts > .context:last-child { border-bottom: 0; }
html.dark .gtheme-register-form .contexts > .context { border-color: rgba(255,255,255,.08); }
.gtheme-register-form fieldset .fields > * { margin-top: 0 !important; }
