/* ============================================
   ACMG Webmail — Custom Branding for Roundcube
   Colors: Teal Green #1a9d7a / #0d7a5f
   ============================================ */

/* --- LOGIN PAGE --- */
body.task-login {
    background: linear-gradient(135deg, #f0fdf4 0%, #e8f5ee 50%, #dcfce7 100%) !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.task-login #layout {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    height: 100vh !important;
}

.task-login #layout-content {
    background: transparent !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
}

/* Kill the default 16vh offset on the logo */
.task-login #logo {
    top: 0 !important;
    position: relative !important;
}

/* Kill the default 20vh offset on the form */
.task-login #login-form {
    top: 0 !important;
    position: relative !important;
}

/* Logo sizing */
#logo {
    max-width: 260px !important;
    height: auto !important;
    margin: 0 auto 28px auto !important;
    display: block !important;
    filter: drop-shadow(0 2px 8px rgba(26, 157, 122, 0.15));
}

/* Login form card */
#login-form {
    background: #fff;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(26, 157, 122, 0.12), 0 2px 8px rgba(0,0,0,0.06) !important;
    padding: 32px 36px !important;
    max-width: 400px;
    width: 100%;
    border: 1px solid rgba(26, 157, 122, 0.12);
}

/* Form inputs */
#login-form .form-control,
#login-form input[type="text"],
#login-form input[type="password"] {
    border: 1.5px solid #d1d5db !important;
    border-radius: 10px !important;
    padding: 12px 14px !important;
    font-size: 14px !important;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafbfc !important;
}

#login-form .form-control:focus,
#login-form input[type="text"]:focus,
#login-form input[type="password"]:focus {
    border-color: #1a9d7a !important;
    box-shadow: 0 0 0 3px rgba(26, 157, 122, 0.15) !important;
    background: #fff !important;
    outline: none !important;
}

/* Input icons */
#login-form .input-group-text,
#login-form .input-group .icon {
    color: #1a9d7a !important;
}

/* Submit button */
#login-form #rcmloginsubmit,
#login-form .button.mainaction,
#login-form input[type="submit"],
#login-form button[type="submit"] {
    background: linear-gradient(135deg, #1a9d7a 0%, #0d7a5f 100%) !important;
    border: none !important;
    border-radius: 10px !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    padding: 12px 24px !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(26, 157, 122, 0.3);
    width: 100%;
    margin-top: 8px;
}

#login-form #rcmloginsubmit:hover,
#login-form .button.mainaction:hover,
#login-form input[type="submit"]:hover,
#login-form button[type="submit"]:hover {
    background: linear-gradient(135deg, #0d7a5f 0%, #065f46 100%) !important;
    box-shadow: 0 6px 20px rgba(26, 157, 122, 0.4) !important;
    transform: translateY(-1px);
}

#login-form #rcmloginsubmit:active,
#login-form .button.mainaction:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(26, 157, 122, 0.3) !important;
}

/* Login footer */
#login-footer {
    text-align: center;
    margin-top: 16px !important;
    color: #6b7280;
    font-size: 12px;
}

#login-footer a {
    color: #1a9d7a !important;
}

/* Form labels */
#login-form label {
    color: #374151 !important;
    font-weight: 500 !important;
    font-size: 13px !important;
}

/* --- GLOBAL THEME OVERRIDES --- */

/* Top toolbar / header */
#layout > .header,
.toolbar,
#taskmenu {
    background: linear-gradient(135deg, #1a9d7a 0%, #0d7a5f 100%) !important;
}

#taskmenu a,
#taskmenu a .inner,
.toolbar a {
    color: #fff !important;
}

#taskmenu a:hover,
#taskmenu a.selected {
    background: rgba(255,255,255,0.15) !important;
}

/* Buttons */
.btn-primary,
.button.mainaction,
a.button.mainaction {
    background: #1a9d7a !important;
    border-color: #1a9d7a !important;
    color: #fff !important;
}

.btn-primary:hover,
.button.mainaction:hover {
    background: #0d7a5f !important;
    border-color: #0d7a5f !important;
}

/* Links */
a {
    color: #1a9d7a;
}
a:hover {
    color: #0d7a5f;
}

/* Selection highlight */
.listing li.selected,
.listing tr.selected td,
#messagelist tr.selected td {
    background: #e6f7f1 !important;
    color: #065f46 !important;
}

/* Folder list active */
#mailboxlist li.selected > a,
.treelist li.selected > a {
    background: #e6f7f1 !important;
    color: #065f46 !important;
    border-left: 3px solid #1a9d7a;
}

/* Page title */
.header-title,
.content-frame-navigation .header {
    color: #1a9d7a !important;
}

/* Scrollbar accent (webkit) */
::-webkit-scrollbar-thumb {
    background: #1a9d7a;
    border-radius: 4px;
}

/* Checkbox accent */
input[type="checkbox"]:checked {
    accent-color: #1a9d7a;
}

/* Title bar (inside) */
.ui-dialog .ui-dialog-titlebar {
    background: #1a9d7a !important;
    color: #fff !important;
}

/* Custom title below logo on login */
#login-form::before {
    content: "Webmail Institucional";
    display: block;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #1a9d7a;
    margin-bottom: 20px;
    letter-spacing: 0.3px;
}

/* Fix image logo sizing on all pages */
.minmodelayout #logo,
#logo img {
    max-height: 40px !important;
    width: auto !important;
}

/* Responsive */
@media (max-width: 640px) {
    #login-form {
        margin: 16px !important;
        padding: 24px 20px !important;
    }
    #logo {
        max-width: 200px !important;
    }
}
