/**
 * Custom dark theme for Roundcube login page - Korium skin
 * Inspired by modern dark UI design
 */

/* Force dark mode on login page */
.task-login {
    background-color: #121212 !important; /* slightly darker background like the screenshot */
    background-image: none !important;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.task-login body {
    background-color: #242424 !important;
    color: #e0e0e0 !important;
}

/* Dark background for the entire page */
.task-login #layout-content {
    background-color: transparent !important;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* Hide logo completely */
.task-login #logo {
    display: none !important;
}

/* Login form container (card) */
.task-login #login-form {
    background-color: #1f1f1f; /* card background from screenshot */
    border-radius: 14px;
    padding: 28px;
    /* Centered, even shadow (no vertical offset) */
    box-shadow: 0 0 36px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    max-width: 480px;
    width: 100%;
    margin: 0 auto !important;
    position: static !important;
    top: auto !important;
}

/* Form title */
.task-login #login-form::before {
    content: "Log in to mail";
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #e8e8e8;
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: 0.2px;
}

/* Input fields */
.task-login #login-form .form-control {
    background-color: #161616 !important; /* inner field */
    border: 1px solid #2b2b2b !important;
    color: #d8d8d8 !important;
    padding: 12px 40px 12px 14px !important; /* a bit smaller */
    font-size: 14px;
    border-radius: 10px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    /* Make inputs visually shorter */
    max-width: 360px;
    width: 100%;
    display: block;
    margin: 0 auto;
}

/* Keep inputs full-width on very small screens */
@media (max-width: 420px) {
  .task-login #login-form .form-control {
    max-width: 100%;
  }
}

.task-login #login-form .form-control:focus {
    background-color: #1a1a1a !important;
    border-color: #3b3b3b !important;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.04) !important;
    outline: none !important;
}

.task-login #login-form .form-control::placeholder {
    color: #9a9a9a !important;
}

/* Keep table semantics. Space rows safely */
.task-login #login-form .form-group { display: block; margin: 0 0 16px 0; }

/* Hide built-in left-side icons, we'll use right-side background icons */
.task-login #login-form .input-group-prepend { display: none !important; }

/* Ensure inputs take full width */
.task-login #login-form td.input { display: block; width: 100%; }
.task-login #login-form .form-control { width: 100%; box-sizing: border-box; }

/* Hide inline labels to match the card layout (we use placeholders) */
.task-login #login-form td.title { display: none !important; }

/* Login button — orange theme */
.task-login #rcmloginsubmit {
    background-color: #2b2419 !important; /* dark orange-toned background */
    border: 1px solid #3a3022 !important;
    color: #ff9f42 !important; /* orange text */
    padding: 12px 18px !important; /* smaller */
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 80ms ease, box-shadow 80ms ease;
    width: 100%;
    margin-top: 18px;
    text-transform: none;
    letter-spacing: 0.2px;
    box-shadow: 0 2px 0 rgba(0,0,0,.35);
}

.task-login #rcmloginsubmit:hover {
    background-color: #332a1e !important;
}

/* Click animation: press effect */
.task-login #rcmloginsubmit:active {
    transform: translateY(1px) scale(0.99);
    box-shadow: 0 1px 0 rgba(0,0,0,.4);
}

/* Remove blue focus halo from the button */
.task-login #rcmloginsubmit:focus,
.task-login #rcmloginsubmit:focus-visible,
.task-login .btn:focus,
.task-login .btn-primary:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Disabled state while loading */
.task-login #rcmloginsubmit[disabled],
.task-login #rcmloginsubmit.is-loading {
    opacity: .6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Keep me logged in checkbox */
.task-login .custom-control-label {
    color: #b0b0b0 !important;
    font-size: 0.9rem;
}

.task-login .custom-control-input:checked ~ .custom-control-label::before {
    background-color: #ff9f42 !important;
    border-color: #ff9f42 !important;
}

/* Footer */
.task-login #login-footer {
    color: #777 !important;
    margin-top: 20px;
    text-align: center;
}

.task-login #login-footer a {
    color: #ff9f42 !important;
    text-decoration: none;
    transition: color 0.3s ease;
}

.task-login #login-footer a:hover {
    color: #ffb169 !important;
    text-decoration: underline;
}

/* Messages — neutral loading, red errors */
.task-login #messagestack .loading {
    background-color: #2a2a2a !important;
    border: 1px solid #3a3a3a !important;
    color: #cfcfcf !important;
    border-radius: 8px;
}

.task-login #messagestack .alert-danger,
.task-login #messagestack .boxerror,
.task-login #messagestack .error {
    background-color: #3d2d2d !important;
    border: 1px solid #5d3d3d !important;
    color: #ff6b6b !important;
    border-radius: 8px;
}

/* Form table adjustments */
.task-login #login-form table {
    width: 100%;
    margin-top: 1.5rem;
}

.task-login #login-form td {
    padding: 0.5rem 0;
}

.task-login #login-form .row {
    margin-bottom: 1.25rem;
}


/* Responsive adjustments */
@media (max-width: 480px) {
    .task-login #login-form {
        padding: 2rem 1.5rem;
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    .task-login #login-form::before {
        font-size: 1.3rem;
    }
}

/* Additional enhancements for modern look */
.task-login #login-form .formbuttons {
    text-align: center;
    margin-top: 1.5rem;
}

/* Hide unnecessary elements */
.task-login .voice {
    display: none;
}

/* Subtle animation on load */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-login #login-form {
    animation: fadeIn 0.6s ease-out;
}

/* Password visibility toggle styling - Keep it simple */
.task-login .input-group-text {
    background-color: #2a2a2a !important;
    border-color: #555 !important;
    color: #888 !important;
}

.task-login .input-group-text:hover {
    color: #ff9f42 !important;
    background-color: #333 !important;
}

/* Background icons for both inputs (simple like original) */
.task-login #login-form #rcmloginuser {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"%23a7a7a7\" viewBox=\"0 0 24 24\"><path d=\"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z\"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px !important;
    padding-right: 40px !important;
}

.task-login #login-form #rcmloginpwd {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"%23a7a7a7\" viewBox=\"0 0 24 24\"><path d=\"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z\"/></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px !important;
    padding-right: 40px !important;
}

/* Hide the native password toggle appended to the password input to avoid double eye */
.task-login #login-form #rcmloginpwd + .input-group-append,
.task-login #login-form #rcmloginpwd ~ .input-group-append {
    display: none !important;
}

/* Hide labels and adjust layout */
.task-login #login-form td.title {
    display: none;
}

/* Override Korium's modern.css for login page */
.task-login .btn {
    border-radius: 6px !important;
}

.task-login a {
    color: #ff9f42 !important;
}

.task-login a:hover {
    color: #ffb169 !important;
}

/* Input group: keep full rounded corners on inputs */
.task-login .input-group .form-control {
    border-radius: 10px !important;
}

.task-login .input-group-text {
    border-radius: 10px !important;
}
