@font-face {
    font-family: "Speedee";
    src: url("../assets/fonts/Speedee.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: "Speedee";
    src: url("../assets/fonts/Speedee-Regular.otf") format("opentype");
    font-weight: 400;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Speedee", sans-serif;
}

body {
    background: linear-gradient(135deg, #ffffff, #f8f8f8);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    height: 100vh;
    animation: fadeIn 0.8s ease-in-out;
    /* Garantiza que position:fixed hijos se posicionen respecto al viewport */
    transform: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.login-container {
    width: 100%;
    max-width: 380px;
    padding: 40px 30px;
    text-align: center;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.08);
    animation: slideUp 0.6s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.logo {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 6px;
    color: #c88e99;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 14px;
    color: #888;
    margin-bottom: 35px;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    font-size: 13px;
    margin-bottom: 6px;
    display: block;
    color: #222;
}

.input-group input {
    width: 100%;
    padding: 13px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    transition: 0.3s;
}

.input-group input:focus {
    border-color: #E89CA9;
    box-shadow: 0 0 0 3px rgba(232,156,169,0.15);
    outline: none;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: #c88e99;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.btn-login:hover {
    background: #a46678;
    transform: translateY(-2px);
}

.divider {
    margin: 25px 0;
    position: relative;
    text-align: center;
}

.divider span {
    background: #fff;
    padding: 0 10px;
    font-size: 12px;
    color: #999;
}

.divider::before {
    content: "";
    height: 1px;
    width: 100%;
    background: #eee;
    position: absolute;
    top: 50%;
    left: 0;
    z-index: -1;
}

.btn-google {
    width: 100%;
    padding: 13px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.25s, border-color 0.25s, transform 0.25s, color 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-google:hover:not(:disabled) {
    border-color: #E89CA9;
    color: #E89CA9;
    transform: translateY(-2px);
}

.btn-google img, .btn-google .g-logo {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Spinner dentro del botón Google */
@keyframes gSpin {
    to { transform: rotate(360deg); }
}

.btn-google .g-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid #e0e0e0;
    border-top-color: #c88e99;
    border-radius: 50%;
    animation: gSpin 0.65s linear infinite;
    flex-shrink: 0;
}

.btn-google.g-loading {
    background: #fafafa;
    color: #999;
    cursor: not-allowed;
    border-color: #e8e8e8;
    transform: none;
}

.btn-google.g-loading .g-spinner { display: block; }
.btn-google.g-loading .g-logo   { display: none; }

.btn-google.g-success {
    background: #e8f5e9;
    border-color: #27ae60;
    color: #1d8348;
    cursor: default;
}

/* ── Overlay de éxito Google Login ── */
@keyframes gOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes gCardUp {
    from { transform: translateY(32px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

@keyframes gRingDraw {
    to { stroke-dashoffset: 0; }
}

@keyframes gCheckDraw {
    to { stroke-dashoffset: 60; }
}

@keyframes gBrandFade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.g-success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    animation: gOverlayIn 0.25s ease forwards;
    /* Evita que body flex lo trate como flex item */
    flex-shrink: 0;
    margin: 0;
}

.g-success-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    animation: gCardUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

.g-success-svg {
    width: 96px;
    height: 96px;
    margin-bottom: 28px;
}

.g-svg-ring {
    fill: none;
    stroke: #c88e99;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 270;
    stroke-dashoffset: 270;
    transform-origin: center;
    transform: rotate(-90deg);
    animation: gRingDraw 0.65s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

.g-svg-check {
    fill: none;
    stroke: #c88e99;
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: gCheckDraw 0.35s cubic-bezier(0.16, 1, 0.3, 1) 0.85s forwards;
}

.g-welcome-name {
    font-size: 22px;
    font-weight: 800;
    color: #111;
    margin-bottom: 8px;
    text-align: center;
    letter-spacing: -0.3px;
}

.g-welcome-sub {
    font-size: 14px;
    color: #aaa;
    text-align: center;
    font-weight: 500;
}

.g-overlay-brand {
    position: absolute;
    bottom: 36px;
    font-size: 11px;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 700;
    color: #ddd;
    opacity: 0;
    animation: gBrandFade 0.4s ease 0.9s forwards;
}

.register-link {
    margin-top: 20px;
    font-size: 13px;
    color: #666;
}

.register-link a {
    color: #E89CA9;
    text-decoration: none;
    font-weight: 600;
}

.register-link a:hover {
    text-decoration: underline;
}

.error-msg {
    background: #f9edf0;
    color: #c88e99;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 18px;
    text-align: left;
}
