/* ====================================
   CETID AUTH PORTAL - VELLUM DESIGN
   Frosted glass authentication UI
   ==================================== */

/* === ANIMATED BACKGROUND STRATA === */
.auth-strata {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9f4 0%, #ede9e0 100%);
}

.auth-strata__blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float-blob 20s ease-in-out infinite;
}

.auth-strata__blob:nth-child(1) {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #e0e5d8 0%, transparent 70%);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.auth-strata__blob:nth-child(2) {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #e8e1d5 0%, transparent 70%);
    top: 50%;
    right: -5%;
    animation-delay: 7s;
    animation-duration: 25s;
}

.auth-strata__blob:nth-child(3) {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #d8ddd0 0%, transparent 70%);
    bottom: -10%;
    left: 40%;
    animation-delay: 14s;
    animation-duration: 30s;
}

@keyframes float-blob {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -30px) scale(1.1);
    }
    50% {
        transform: translate(-20px, 20px) scale(0.9);
    }
    75% {
        transform: translate(20px, 10px) scale(1.05);
    }
}

/* === VELLUM LAYERS === */
.auth-vellum {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-vellum__sheet {
    background: rgba(252, 251, 247, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    max-width: 1000px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

/* Subtle paper texture overlay */
.auth-vellum__sheet::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.01) 2px,
            rgba(0, 0, 0, 0.01) 4px
        );
    pointer-events: none;
    opacity: 0.3;
}

/* === AUTH PORTAL LAYOUT === */
.auth-portal {
    display: flex;
    min-height: 600px;
    position: relative;
    z-index: 2;
}

/* === LEFT SIDEBAR === */
.auth-portal__sidebar {
    flex: 0 0 320px;
    background: linear-gradient(165deg, rgba(189, 39, 45, 0.05) 0%, rgba(189, 39, 45, 0.02) 100%);
    padding: 3rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-right: 1px solid rgba(189, 39, 45, 0.1);
    position: relative;
}

.auth-portal__sidebar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(189, 39, 45, 0.1) 20%,
        rgba(189, 39, 45, 0.1) 80%,
        transparent
    );
}

.auth-portal__logo {
    margin-bottom: 2rem;
}

.auth-portal__logo-img {
    max-width: 180px;
    height: auto;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.auth-portal__journal-info {
    color: #1a1a1a;
}

.auth-portal__journal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #BD272D;
    line-height: 1.3;
}

.auth-portal__journal-subtitle {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4a4a4a;
    margin-bottom: 2rem;
    font-weight: 400;
}

.auth-portal__meta {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.8;
}

.auth-portal__meta-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.auth-portal__meta-label {
    font-weight: 600;
    margin-right: 0.5rem;
    color: #1a1a1a;
}

/* === RIGHT FORM AREA === */
.auth-portal__form-area {
    flex: 1;
    padding: 3rem 3rem 3rem 4rem;
    display: flex;
    flex-direction: column;
}

.auth-portal__header {
    margin-bottom: 2rem;
}

.auth-portal__welcome {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.auth-portal__title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

/* === TAB NAVIGATION === */
.auth-portal__tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
    border-bottom: 2px solid rgba(189, 39, 45, 0.1);
}

.auth-portal__tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.auth-portal__tab:hover {
    color: #1a1a1a;
    background: rgba(189, 39, 45, 0.03);
}

.auth-portal__tab.active {
    color: #BD272D;
    border-bottom-color: #BD272D;
}

.auth-portal__tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: #BD272D;
}

/* === FORM STYLES === */
.auth-portal__form {
    flex: 1;
}

.auth-portal__form-group {
    margin-bottom: 1.75rem;
}

.auth-portal__label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
    letter-spacing: 0.01em;
}

.auth-portal__input {
    width: 100%;
    padding: 0.75rem 0;
    font-size: 1rem;
    color: #1a1a1a;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(26, 26, 26, 0.2);
    transition: all 0.3s ease;
    font-family: inherit;
}

.auth-portal__input:focus {
    outline: none;
    border-bottom-color: #BD272D;
}

.auth-portal__input::placeholder {
    color: #999;
}

/* Floating label effect */
.auth-portal__form-group.floating .auth-portal__label {
    position: absolute;
    top: 0.75rem;
    left: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.auth-portal__form-group.floating .auth-portal__input:focus ~ .auth-portal__label,
.auth-portal__form-group.floating .auth-portal__input:not(:placeholder-shown) ~ .auth-portal__label {
    top: -1.5rem;
    font-size: 0.85rem;
    color: #BD272D;
}

/* === CHECKBOX === */
.auth-portal__checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 1.75rem;
}

.auth-portal__checkbox {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
    cursor: pointer;
    accent-color: #BD272D;
}

.auth-portal__checkbox-label {
    font-size: 0.9rem;
    color: #4a4a4a;
    cursor: pointer;
    user-select: none;
}

/* === SUBMIT BUTTON === */
.auth-portal__submit {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    background: #1a1a1a;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-top: 1rem;
}

.auth-portal__submit::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(189, 39, 45, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.auth-portal__submit:hover {
    background: #2a2a2a;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(26, 26, 26, 0.2);
}

.auth-portal__submit:hover::before {
    width: 400px;
    height: 400px;
}

.auth-portal__submit:active {
    transform: translateY(0);
}

/* === FOOTER LINKS === */
.auth-portal__footer {
    margin-top: 2rem;
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(26, 26, 26, 0.1);
}

.auth-portal__link {
    color: #BD272D;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.auth-portal__link:hover {
    color: #8f1e22;
    text-decoration: underline;
}

.auth-portal__divider {
    margin: 0 0.75rem;
    color: #ccc;
}

/* === HELPER TEXT === */
.auth-portal__helper {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
    line-height: 1.5;
}

.auth-portal__error {
    font-size: 0.85rem;
    color: #BD272D;
    margin-top: 0.5rem;
}

/* === LOADING STATE === */
.auth-portal__submit.loading {
    pointer-events: none;
    opacity: 0.7;
}

.auth-portal__submit.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .auth-portal {
        flex-direction: column;
        min-height: auto;
    }

    .auth-portal__sidebar {
        flex: 0 0 auto;
        padding: 2rem 1.5rem;
        border-right: none;
        border-bottom: 1px solid rgba(189, 39, 45, 0.1);
    }

    .auth-portal__sidebar::after {
        display: none;
    }

    .auth-portal__logo-img {
        max-width: 140px;
    }

    .auth-portal__journal-title {
        font-size: 1.25rem;
    }

    .auth-portal__journal-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .auth-portal__meta {
        font-size: 0.8rem;
    }

    .auth-portal__form-area {
        padding: 2rem 1.5rem;
    }

    .auth-portal__title {
        font-size: 1.5rem;
    }

    .auth-portal__tabs {
        margin-bottom: 1.5rem;
    }

    .auth-portal__tab {
        padding: 0.6rem 1rem;
        font-size: 0.95rem;
    }

    .auth-vellum {
        padding: 1rem;
    }

    .auth-vellum__sheet {
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    .auth-vellum {
        padding: 0.5rem;
    }

    .auth-vellum__sheet {
        border-radius: 12px;
    }

    .auth-portal__sidebar {
        padding: 1.5rem 1rem;
    }

    .auth-portal__form-area {
        padding: 1.5rem 1rem;
    }

    .auth-portal__title {
        font-size: 1.35rem;
    }

    .auth-portal__welcome {
        font-size: 1rem;
    }

    .auth-portal__submit {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
    .auth-strata__blob,
    .auth-portal__submit::before,
    .auth-portal__tab,
    .auth-portal__input {
        animation: none;
        transition: none;
    }
}

/* === PRINT STYLES === */
@media print {
    .auth-strata,
    .auth-vellum__sheet::before {
        display: none;
    }

    .auth-vellum__sheet {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* === HIGH CONTRAST MODE === */
@media (prefers-contrast: high) {
    .auth-vellum__sheet {
        background: rgba(255, 255, 255, 0.95);
        border: 2px solid #1a1a1a;
    }

    .auth-portal__input {
        border-bottom-width: 3px;
    }

    .auth-portal__tab.active {
        border-bottom-width: 3px;
    }
}

/* === DARK MODE (OPTIONAL) === */
@media (prefers-color-scheme: dark) {
    .auth-strata {
        background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    }

    .auth-strata__blob:nth-child(1) {
        background: radial-gradient(circle, rgba(189, 39, 45, 0.15) 0%, transparent 70%);
    }

    .auth-strata__blob:nth-child(2) {
        background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    }

    .auth-strata__blob:nth-child(3) {
        background: radial-gradient(circle, rgba(189, 39, 45, 0.1) 0%, transparent 70%);
    }

    .auth-vellum__sheet {
        background: rgba(30, 30, 30, 0.8);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .auth-portal__sidebar {
        background: linear-gradient(165deg, rgba(189, 39, 45, 0.1) 0%, rgba(189, 39, 45, 0.05) 100%);
        border-right-color: rgba(189, 39, 45, 0.2);
    }

    .auth-portal__journal-info {
        color: #e0e0e0;
    }

    .auth-portal__journal-title {
        color: #ff6b70;
    }

    .auth-portal__journal-subtitle {
        color: #b0b0b0;
    }

    .auth-portal__title,
    .auth-portal__label {
        color: #e0e0e0;
    }

    .auth-portal__welcome {
        color: #999;
    }

    .auth-portal__input {
        color: #e0e0e0;
        border-bottom-color: rgba(255, 255, 255, 0.3);
    }

    .auth-portal__input::placeholder {
        color: #666;
    }

    .auth-portal__tab {
        color: #999;
    }

    .auth-portal__tab:hover {
        color: #e0e0e0;
        background: rgba(189, 39, 45, 0.1);
    }

    .auth-portal__tab.active {
        color: #ff6b70;
        border-bottom-color: #ff6b70;
    }

    .auth-portal__submit {
        background: #f0f0f0;
        color: #1a1a1a;
    }

    .auth-portal__submit:hover {
        background: #fff;
    }

    .auth-portal__link {
        color: #ff6b70;
    }

    .auth-portal__link:hover {
        color: #ff9094;
    }

    .auth-portal__footer {
        border-top-color: rgba(255, 255, 255, 0.1);
    }
}

/* === REGISTRATION FORM STYLES === */

/* Wider sheet for registration */
.auth-vellum__sheet--wide {
    max-width: 1100px;
}

.auth-portal--register {
    min-height: 500px;
}

.auth-portal--register .auth-portal__form-area {
    overflow-y: auto;
    max-height: 80vh;
}

/* Style OJS registration form fields */
.auth-portal__form .form-group,
.auth-portal__form .pkp_form .fields {
    margin-bottom: 1.25rem;
}

.auth-portal__form fieldset {
    border: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
}

.auth-portal__form legend {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(189, 39, 45, 0.2);
    width: 100%;
}

.auth-portal__form label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

.auth-portal__form input[type="text"],
.auth-portal__form input[type="email"],
.auth-portal__form input[type="password"],
.auth-portal__form select,
.auth-portal__form textarea {
    width: 100%;
    padding: 0.75rem 0;
    font-size: 1rem;
    color: #1a1a1a;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(26, 26, 26, 0.2);
    transition: all 0.3s ease;
    font-family: inherit;
}

.auth-portal__form input[type="text"]:focus,
.auth-portal__form input[type="email"]:focus,
.auth-portal__form input[type="password"]:focus,
.auth-portal__form select:focus,
.auth-portal__form textarea:focus {
    outline: none;
    border-bottom-color: #BD272D;
}

.auth-portal__form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    padding-right: 20px;
}

/* Required field indicator */
.auth-portal__required {
    color: #BD272D;
}

/* Select dropdown */
.auth-portal__select {
    width: 100%;
    padding: 0.75rem 0;
    font-size: 1rem;
    color: #1a1a1a;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(26, 26, 26, 0.2);
    transition: all 0.3s ease;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
}

.auth-portal__select:focus {
    outline: none;
    border-bottom-color: #BD272D;
}

/* Privacy and consent section */
.auth-portal__privacy {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(26, 26, 26, 0.1);
}

/* Captcha container */
.auth-portal__captcha {
    margin: 1.5rem 0;
}

/* Form row for side-by-side elements */
.auth-portal__form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Style for form errors */
.auth-portal__error,
.pkp_form_error {
    background: rgba(189, 39, 45, 0.1);
    border: 1px solid rgba(189, 39, 45, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: #8f1e22;
}

/* Dark mode adjustments for registration */
@media (prefers-color-scheme: dark) {
    .auth-portal__form legend {
        color: #e0e0e0;
        border-bottom-color: rgba(189, 39, 45, 0.3);
    }
    
    .auth-portal__form label {
        color: #e0e0e0;
    }
    
    .auth-portal__form input[type="text"],
    .auth-portal__form input[type="email"],
    .auth-portal__form input[type="password"],
    .auth-portal__form select,
    .auth-portal__form textarea,
    .auth-portal__select {
        color: #e0e0e0;
        border-bottom-color: rgba(255, 255, 255, 0.3);
    }
    
    .auth-portal__form select {
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    }
}

/* Hide OJS default footer on auth pages */
body.page_login .site-footer,
body.page_user .site-footer,
.auth-vellum ~ footer,
.auth-vellum ~ .pkp_structure_footer {
    display: none;
}
