/*
 * Login page (app/Views/auth/login.php)
 */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #e1ebf8;
    position: relative;
}

.login-wrapper {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

.login-card {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    padding: 48px 40px 36px;
}

.login-brand {
    text-align: center;
    margin-bottom: 24px;
}

.login-brand img {
    max-width: 197px;
    height: auto;
}

.login-brand .divider {
    width: 40px;
    height: 3px;
    background: #f36f21;
    border-radius: 2px;
    margin: 20px auto;
}

.login-brand h1 {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 4px;
}

.login-brand p {
    font-size: 14px;
    color: #818285;
    margin: 0;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper .input-field {
    width: 100%;
    padding: 12px 16px 12px 44px;
    font-size: 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    color: #1f2937;
    transition: all 0.2s;
    outline: none;
    min-height: auto;
}

.input-wrapper .input-field:focus {
    border-color: #f36f21;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(243, 111, 33, 0.1);
}

.input-wrapper .input-field.is-invalid {
    border-color: #d93025;
}

.input-wrapper .input-field::placeholder {
    color: #9ca3af;
}

.input-wrapper .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 18px;
    pointer-events: none;
}

.input-wrapper .input-field:focus ~ .input-icon {
    color: #f36f21;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 6px;
    font-size: 18px;
    display: flex;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.password-toggle:hover {
    background: #f3f4f6;
    color: #374151;
}

.invalid-feedback-custom {
    font-size: 12px;
    color: #d93025;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.alert-custom {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    margin-bottom: 20px;
}

.alert-custom-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-custom-danger i {
    font-size: 18px;
    color: #ef4444;
    flex-shrink: 0;
}

.alert-custom-denied {
    background: #fef2f2;
    border: 2px solid #ef4444;
    color: #991b1b;
    font-size: 15px;
    padding: 16px 18px;
}

.alert-custom-denied i {
    font-size: 30px;
    color: #ef4444;
    flex-shrink: 0;
}

.alert-custom-denied strong {
    display: block;
    font-size: 17px;
    margin-bottom: 2px;
}

.btn-login {
    width: 100%;
    padding: 13px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: #f36f21;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 6px;
}

.btn-login:hover {
    background: #e05e0e;
    box-shadow: 0 4px 16px rgba(243, 111, 33, 0.3);
    transform: translateY(-1px);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    background: #f5a472;
    cursor: default;
    box-shadow: none;
    transform: none;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.turnstile-wrapper {
    display: flex;
    justify-content: center;
    margin: 4px 0 18px;
}

.login-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18px 0 0;
}

.login-links a {
    font-size: 13px;
    font-weight: 500;
    color: #818285;
    text-decoration: none;
    transition: color 0.15s;
}

.login-links a:hover {
    color: #f36f21;
}

.login-links .link-primary {
    color: #f36f21;
    font-weight: 600;
}

.login-links .link-primary:hover {
    color: #e05e0e;
}

.brand-footer {
    text-align: center;
    margin-top: 24px;
}

.brand-footer span {
    font-size: 12px;
    color: #737686;
}

@media (max-width: 480px) {
    .login-card { padding: 36px 24px 28px; }
    .login-brand img { height: 48px; }
    .login-brand h1 { font-size: 20px; }
}

/* Titulo CRM con el icono de la plataforma, como en el topbar. */
.login-brand h1.brand-app {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-family: "Poppins", sans-serif;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 3px;
    color: #737686;
}

.login-brand h1.brand-app img {
    width: auto;
    max-width: none;
    height: 34px;
}

/* Modal "guardar este dispositivo" tras validar la contrasena (Auth::login()) */
.trust-modal-dialog { max-width: 420px; }
.trust-modal .modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    padding: 36px 32px 28px;
    text-align: center;
}
.trust-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #fdeadc;
    color: #ef6f21;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.trust-modal h2 { font-size: 20px; font-weight: 700; color: #2e3032; margin-bottom: 8px; }
.trust-modal p { font-size: 14px; color: #6b7280; margin-bottom: 24px; }
.trust-modal .btn-login + .btn-trust-skip { margin-top: 10px; }
.btn-trust-skip {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #4b5563;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-trust-skip:hover { border-color: #ef6f21; color: #ef6f21; }
