* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden; /* evitar overflow lateral */
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

/* PAGE */

.login-page {
    width: 100%;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
    background: #f5f5f5;
}

/* CARD */
.login-card {
    width: 100%;
    max-width: 430px;
    margin: 0 auto; /* centrar sin usar vw */
    background: white;
    border-radius: 28px;
    padding: 34px;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
    overflow: hidden;
    box-sizing: border-box;
}



/* HEADER */

.form-header {
    width: 100%;
    text-align: center;
    margin-bottom: 28px;
}

    .form-header h1 {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
        margin: 0 0 12px 0;
        font-size: 34px;
        line-height: 1.2;
        font-weight: 800;
        color: #181818;
        overflow-wrap: break-word;
        word-break: break-word;
    }

.header-icon {
    flex-shrink: 0;
}

.form-header p {
    margin: 0;
    color: #666;
    line-height: 1.5;
    overflow-wrap: break-word;
}

.form-header a {
    color: #ff6b00;
    text-decoration: none;
    font-weight: 700;
}

    .form-header a:hover {
        text-decoration: underline;
    }

/* FORM */

.form-container {
    width: 100%;
}

.form-grid {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

    .form-grid > div {
        width: 100%;
        min-width: 0;
    }

    .form-grid label {
        display: block;
        margin-bottom: 8px;
        font-weight: 700;
        color: #333;
    }

    .form-grid input {
        max-width: 100%;
        height: auto;
                word-break: break-word;

        display: block;
        width: 100%;
        
        min-width: 0;
        padding: 15px;
        border: 1px solid #ddd;
        border-radius: 16px;
        font-size: 16px;
        background: #fafafa;
        transition: .2s;
        box-sizing: border-box;
    }

        .form-grid input:focus {
            outline: none;
            border-color: #ff7a00;
            background: white;
            box-shadow: 0 0 0 4px rgba(255,122,0,.12);
        }

    /* BUTTON */

    .form-grid button {
        max-width: 100%;
        height: auto;
        box-sizing: border-box;
        word-break: break-word;

        position: relative;
        width: 100%;
        border: none;
        border-radius: 18px;
        padding: 16px;
        font-size: 16px;
        font-weight: 800;
        color: white;
        cursor: pointer;
        transition: .2s;
        background: var(--primary);
        overflow: hidden;
       
    }

        .form-grid button:hover {
            opacity: .95;
            transform: translateY(-1px);
        }

        .form-grid button:active {
            transform: translateY(1px);
            box-shadow: inset 0 2px 6px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.2);
        }


/* VALIDATIONS */

.validation-message {
    display: block;
    margin-top: 5px;
    color: #d90000;
    font-size: 13px;
    overflow-wrap: break-word;
}

/* TOAST */

.toast-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

.toast-card {
    width: 100%;
    max-width: 360px;
    background: white;
    border-radius: 24px;
    padding: 28px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

    .toast-card.success {
        border-top: 6px solid #22c55e;
    }

    .toast-card.error {
        border-top: 6px solid #E8543F;
    }

.toast-text {
    margin: 18px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    overflow-wrap: break-word;
}

.toast-close {
    border: none;
    border-radius: 14px;
    padding: 12px 18px;
    background: #f3f4f6;
    cursor: pointer;
    font-weight: 700;
}

/* SUCCESS ICON */

.checkmark {
    width: 70px;
    height: 70px;
    position: relative;
    margin: auto;
}

.checkmark-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #22c55e;
}

.checkmark-stem {
    position: absolute;
    width: 4px;
    height: 22px;
    background: white;
    left: 34px;
    top: 20px;
    transform: rotate(45deg);
}

.checkmark-kick {
    position: absolute;
    width: 12px;
    height: 4px;
    background: white;
    left: 23px;
    top: 38px;
    transform: rotate(45deg);
}

/* ERROR ICON */

.icon-error {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: #E8543F;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: auto;
    font-size: 34px;
    font-weight: 900;
}

/* MOBILE */

@media (max-width: 640px) {

    .login-page {
        padding: 12px;
        align-items: flex-start;
    }

    .login-card {
        width: 100%;
        max-width: 100%;
        margin-top: 16px;
        padding: 20px;
        border-radius: 20px;
    }

    .form-header h1 {
        font-size: 24px;
    }

    .form-header p {
        font-size: 14px;
    }

    .form-grid input {
        padding: 14px;
        font-size: 16px;
    }

    .form-grid button {
        padding: 15px;
    }
}
.login-alert-error {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #be123c;
    padding: 11px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}