/* ============================================================
   Vaultwarden Honeypot — Style
   Mirrors Bitwarden/Vaultwarden Web Vault login page
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body {
    margin: 0;
    font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #333;
    text-align: left;
    background-color: #f8f9fa;
}

body.layout_frontend {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #175DDC 0%, #0a2e6e 100%);
    padding: 20px;
}

a {
    color: #175DDC;
    text-decoration: none;
    background-color: transparent;
}

a:hover {
    color: #1252a3;
    text-decoration: underline;
}

img {
    vertical-align: middle;
    border-style: none;
}

/* --- Container --- */
.container {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
}

/* --- Login Card --- */
.login-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    padding: 40px 36px 30px;
    position: relative;
    overflow: hidden;
}

/* --- Logo --- */
.logo-wrapper {
    text-align: center;
    margin-bottom: 18px;
}

.logo {
    width: 56px;
    height: 56px;
    filter: invert(31%) sepia(86%) saturate(2266%) hue-rotate(202deg) brightness(91%) contrast(96%);
}

/* --- Title --- */
.login-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 500;
    color: #333;
    margin: 0 0 24px;
    line-height: 1.2;
}

/* --- Error Message --- */
.error-message {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fce4e4;
    border: 1px solid #c83522;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 18px;
    color: #c83522;
    font-size: 0.9rem;
    line-height: 1.4;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.icon-error {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background: #c83522;
    border-radius: 50%;
    position: relative;
}

.icon-error::before,
.icon-error::after {
    content: '';
    position: absolute;
    background: #fff;
    border-radius: 1px;
}

.icon-error::before {
    width: 10px;
    height: 2px;
    top: 9px;
    left: 5px;
    transform: rotate(45deg);
}

.icon-error::after {
    width: 10px;
    height: 2px;
    top: 9px;
    left: 5px;
    transform: rotate(-45deg);
}

/* --- Form --- */
.login-form {
    margin-bottom: 12px;
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.form-control {
    display: block;
    width: 100%;
    height: 42px;
    padding: 6px 12px;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.5;
    color: #333;
    background-color: #ffffff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 6px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    outline: none;
}

.form-control:focus {
    border-color: #175DDC;
    box-shadow: 0 0 0 3px rgba(23, 93, 220, 0.15);
}

.form-control::placeholder {
    color: #adb5bd;
}

/* --- Password wrapper (with eye toggle) --- */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-control {
    padding-right: 44px;
}

.toggle-password {
    position: absolute;
    right: 0;
    top: 0;
    height: 42px;
    width: 42px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.55;
    transition: opacity 0.15s;
    padding: 0;
}

.toggle-password:hover {
    opacity: 1;
}

.eye-icon {
    font-size: 18px;
    line-height: 1;
    user-select: none;
}

/* --- Button --- */
.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    padding: 8px 20px;
    font-size: 0.95rem;
    line-height: 1.5;
    border-radius: 6px;
    transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out,
                box-shadow 0.15s ease-in-out, opacity 0.15s ease-in-out;
    outline: none;
}

.btn:focus {
    box-shadow: 0 0 0 3px rgba(23, 93, 220, 0.25);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    color: #ffffff;
    background-color: #175DDC;
    border-color: #175DDC;
}

.btn-primary:hover:not(:disabled) {
    background-color: #134eb9;
    border-color: #1249ad;
}

.btn-primary:active:not(:disabled) {
    background-color: #1044a0;
    border-color: #0f3f94;
}

.btn-block {
    display: block;
    width: 100%;
}

.form-actions {
    margin-top: 8px;
}

/* --- Email display in step 2 --- */
.email-display {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 16px;
    padding: 8px 12px;
    background: #f1f3f5;
    border-radius: 6px;
    word-break: break-all;
}

/* --- Login options --- */
.login-options {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e9ecef;
}

.login-option-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #175DDC;
    font-size: 0.875rem;
    padding: 6px 0;
}

.login-option-link:hover {
    text-decoration: underline;
}

.icon-device {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 1.5px solid #175DDC;
    border-radius: 3px;
    position: relative;
}

.icon-device::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 3px;
    background: #175DDC;
    border-radius: 0 0 1px 1px;
}

/* --- Login hints (back, hint) --- */
.login-hints {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.hint-link {
    font-size: 0.85rem;
    color: #6c757d;
}

.hint-link:hover {
    color: #175DDC;
    text-decoration: underline;
}

/* --- Spinner --- */
.spinner-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    z-index: 10;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e9ecef;
    border-top-color: #175DDC;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* --- Footer --- */
.login-footer {
    text-align: center;
    margin-top: 28px;
}

.version {
    font-size: 0.78rem;
    color: #adb5bd;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    body.layout_frontend {
        background: #ffffff;
        padding: 0;
        align-items: flex-start;
    }

    .login-card {
        border-radius: 0;
        box-shadow: none;
        padding: 32px 20px 24px;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }
}
