.pg_signin {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.pg_signin .sign-in {
    display: none;
}

/* MAIN CONTAINER */
.signin-container {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4rem 2rem 1.6rem;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    min-height: calc(100vh - 195px); /* navbar height */
}

#signinForm{
    max-width: 320px;
}
.signin-form-container {
    background: linear-gradient(135deg, #f8fbff 0%, #e8f4f8 100%);
    border: 2px solid #4a90a4;
    border-radius: 20px;
    padding: 1.8rem 2rem 2rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 500px;
    order: 2;
    flex: 1;
    min-width: 325px;
}
.signin-form-container.popular {
    border: 2px solid #4a90a4;
}
.signin-header {
    background: transparent url(/static/img/brand/logo_idazery_public.png) 14px 2px no-repeat;
    background-size: 38px auto;
    width: fit-content;
    padding: 0 41px 0 62px;
    margin: 0 auto;
}

.signin-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 7px 0 6px;
    text-align: center;
}

.signin-subtitle {
    color: #666;
    font-size: 1rem;
    text-align: center;
    padding-bottom: 2rem;
}

.signin-2fa-container .signin-form-container{
    max-width: 390px;
}

.signin-2fa-container .signin-subtitle{
    margin-top: 1.5rem;
}


.signin-link {
    text-align: center;
    padding: 6px 0;
    margin-top: -20px;
}
.signin-text {
    font-size: 14.5px;
    color: #515961;
    margin: 3rem 0 0;
}
.link-here {
    margin-top: 1px;
}
.signin-form-container .form-group {
    margin: 0 0 1rem 0;  /* Sobrescribe margin: 25px auto de idazery.css */
    position: relative;
    max-width: none;
}

.signin-form-container .form-group label.float {
    top: -8px;  /* Mantiene la posición flotante correcta */
}

.signin-form-container .form-group input {
    font-family: inherit;
}

.form-group-half {
    flex: 1;
    position: relative;
    margin: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.password-requirements {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
    padding-left: 0.5rem;
}

.password-requirements ul {
    margin-top: 0.25rem;
    padding-left: 1.25rem;
}

.password-requirements li {
    margin-bottom: 0.25rem;
}

.submit-button {
    width: 100%;
    background: linear-gradient(135deg, #0891b2 0%, #19b2cb 100%);
    box-shadow: 0 4px 15px rgba(74, 144, 164, 0.3);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(74, 144, 164, 0.3);
}

.submit-button:hover,
.submit-button:active {
    background: linear-gradient(135deg, #37b9cf 0%, #34aee7 50%, #19b2cb 100%);
    box-shadow: 0 8px 25px rgba(74, 144, 164, 0.4);
}

.signin-remember-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #555;
    cursor: pointer;
}
.signin-remember-label input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
}

.cancel-note {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.75rem;
    font-weight: 600;
}


/* Security info */
.security-info {
    background-color: rgb(238 255 255);
    border: 1px solid #71bbc9ab;
    border-radius: 12px;
    padding: 16px;
    margin: 15px auto;
    text-align: center;
    max-width: 330px;
}

.security-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 7px;
}

.security-icon {
    width: 30px;
    height: 30px;
    opacity: 0.7;
    color: #00638b;
}

.security-text {
    font-size: 12px;
    color: #21627b;
    line-height: 1.5;
}


.terms-note {
    text-align: center;
    font-size: 0.75rem;
    color: #666;
    max-width: 405px;
    margin: 0 auto;
    line-height: 1.6;
}

.terms-note a {
    color: #4a90a4;
    text-decoration: none;
}

.terms-note a:hover {
    text-decoration: underline;
}

/* FOOTER */

.separator {
    color: rgba(44, 62, 80, 0.3);
}

/* MOBILE COLLAPSE FUNCTIONALITY */

.mobile-change-link {
    font-size: 0.8rem;
    color: #4a90a4;
    text-decoration: none;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border: 1px solid #4a90a4;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.mobile-change-link:hover {
    background: #4a90a4;
    color: white;
}

.pg_signin .footer-section {
    padding-top: 0px;
}

/* Notice inline para email existente - Versión suave */
.existing-account-notice {
    padding: 1rem 1.25rem;
    margin-top: 0.2rem;
    margin-bottom: 1.5rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border: 1px solid #fde047;
    animation: slideDown 0.3s ease;
}

.notice-content {
    width: 100%;
}

.notice-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #713f12;
    margin: 0 0 0.375rem 0;
}

.notice-text {
    font-size: 0.875rem;
    color: #854d0e;
    margin: 0;
    line-height: 1.5;
}

.notice-link-primary {
    color: #a16207;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid #a16207;
    transition: all 0.2s ease;
}

.notice-link-primary:hover {
    color: #713f12;
    border-bottom-color: #713f12;
}


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


/* RESPONSIVE */
@media (max-width: 1024px) {
    .signin-container {
        gap: 1.5rem;
    }

}

/* Tablet: dos columnas desde 768px */
@media (min-width: 769px) and (max-width: 1024px) {
    .signin-form-container {
        flex: 1;
    }
}

@media (max-width: 640px) {
    .signin-form-container {
        max-width: 450px;
    }
}

@media (max-width: 450px) {
    .signin-form-container {
        padding: 1rem;
    }
    .signin-header{
        background: transparent url(/static/img/brand/logo_idazery_public.png) 1px 7px no-repeat;
        background-size: 38px auto;
        padding: 0 24px 0 46px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   TWO-STEP SIGNIN FLOW
   ═══════════════════════════════════════════════════════════════ */

/* Identity display: uses existing .form-group div.readonly base styles.
   Clickable to return to step 1. Edit icon absolutely positioned. */
.signin-identity-readonly {
    cursor: pointer;
    padding-right: 2.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.signin-identity-readonly:hover {
    border-color: #17a2c5;
    background-color: white;
}

.signin-identity-edit {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #248fa3;
    font-size: 15px;
    padding: 4px 6px;
    border-radius: 4px;
    line-height: 1;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.signin-identity-edit:hover {
    color: #1f7a8c;
    background-color: rgba(36, 143, 163, 0.12);
}

/* "Account not found" inline message (reuses existing slideDown keyframe) */
.signin-not-found {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid #fdba74;
    border-radius: 10px;
    padding: 0.85rem 1.1rem;
    margin-bottom: 1rem;
    animation: slideDown 0.25s ease;
    display: flex;
    align-items: center;
}

.signin-not-found-msg {
    font-size: 0.875rem;
    color: #9a3412;
    margin: 0 auto;
    line-height: 1.5;
}

.signin-not-found--cta {
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.signin-not-found--cta:hover {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    border-color: #fb923c;
}

.signin-not-found--cta:focus-visible {
    outline: 2px solid #ea580c;
    outline-offset: 2px;
}

/* Inline message in Step 2 (errors and magic link success) */
.signin-inline-error {
    margin-top: 0.65rem;
    padding: 0.7rem 1rem;
    border-radius: 8px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
    font-size: 0.875rem;
    line-height: 1.5;
    animation: slideDown 0.2s ease;
}

.signin-inline-error.signin-inline-success {
    background: #f0fdf4;
    border-color: #86efac;
    color: #166534;
}

/* Magic link in step 1: disabled until identity field has a value */
.signin-magic-disabled {
    opacity: 0.35;
    pointer-events: none;
    cursor: default;
}

/* Magic link styled as a plain link (used in both steps) */
.signin-magic-link {
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
}
#signinResetBtn {
    white-space: nowrap;
}
.signin-btn--signup { margin-bottom: 2rem; }

/* Arrow animation for "Start my diary" button */
.signin-btn-arrow {
    display: inline-block;
    transition: transform 0.3s ease;
    will-change: transform;
}

.signin-btn--signup:hover .signin-btn-arrow {
    transform: translateX(4px);
}
