/**
 * Virtmo Mail — Skin CSS
 * Chargé après skins/elastic/styles/styles.min.css
 * Basé sur l'analyse du DOM réel de Roundcube 1.6.5
 */

/* ═══════════════════════════════════════════════════════
   1. POLICE — Inter (self-hosted, remplace Roboto)
═══════════════════════════════════════════════════════ */
@font-face {
    font-family: 'Inter';
    font-style:  normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter-latin-wght-normal.woff2') format('woff2');
}

body, button, input, optgroup, select, textarea, .popover {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* ═══════════════════════════════════════════════════════
   2. LIENS — remplace #00acff par vert
═══════════════════════════════════════════════════════ */
a           { color: #059669 !important; }
a:hover     { color: #047857 !important; }
a.disabled  { opacity: 0.45 !important; }

/* ═══════════════════════════════════════════════════════
   3. FOND — body + panels
═══════════════════════════════════════════════════════ */
body {
    background-color: #F0FDF4 !important;
    color: #1F2937 !important;
}

#layout-sidebar,
#layout-list,
#layout-content {
    background-color: #ffffff !important;
}

/* ═══════════════════════════════════════════════════════
   4. TASKMENU — barre icônes gauche
═══════════════════════════════════════════════════════ */
#layout-menu {
    background-color: #064E3B !important;
}

#layout-menu .popover-header {
    background-color: #064E3B !important;
}

#taskmenu a {
    color: rgba(255,255,255,0.58) !important;
}
#taskmenu a:hover {
    color: #ffffff !important;
    background-color: rgba(255,255,255,0.07) !important;
}
#taskmenu a.selected,
#taskmenu a.selected:hover {
    color: #ffffff !important;
    background-color: #047857 !important;
    box-shadow: inset 3px 0 0 #6EE7B7 !important;
}
#taskmenu .action-buttons a {
    color: #6EE7B7 !important;
    background: transparent !important;
}
#taskmenu .action-buttons a:hover {
    color: #ffffff !important;
    background-color: rgba(255,255,255,0.07) !important;
}
#taskmenu .special-buttons {
    background-color: #064E3B !important;
}
#taskmenu a.logout       { color: #FCA5A5 !important; }
#taskmenu a.logout:hover {
    background-color: rgba(239,68,68,0.12) !important;
    color: #FCA5A5 !important;
}

/* ═══════════════════════════════════════════════════════
   5. HEADERS / TOOLBARS des panels
═══════════════════════════════════════════════════════ */
#layout > div > .header,
#layout > div > .footer {
    background-color: #ffffff !important;
    border-color: #E5E7EB !important;
}

#layout > div > .header .header-title {
    color: #1F2937 !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
}

.header-title.username {
    color: #047857 !important;
    font-size: 0.78rem !important;
    font-weight: 500 !important;
}

.toolbar a.button,
#layout > div > .header a.button {
    color: #374151 !important;
    border-radius: 6px !important;
}
.toolbar a.button:hover,
#layout > div > .header a.button:hover {
    background-color: #F0FDF4 !important;
    color: #047857 !important;
}

/* Bouton Écrire */
.action-buttons a.button {
    background-color: #10B981 !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
}
.action-buttons a.button:hover {
    background-color: #059669 !important;
}

/* Barre de recherche */
.searchbar, .searchbox {
    background-color: #F9FAFB !important;
    border-color: #D1FAE5 !important;
}
.searchbar input[type="text"],
.searchbox input[type="text"] {
    background-color: #ffffff !important;
    border: 1px solid #E5E7EB !important;
    border-radius: 6px !important;
    color: #1F2937 !important;
}
.searchbar input:focus,
.searchbox input:focus {
    border-color: #10B981 !important;
    box-shadow: 0 0 0 3px rgba(16,185,129,0.15) !important;
    outline: none !important;
}

/* ═══════════════════════════════════════════════════════
   6. LISTE DES DOSSIERS
═══════════════════════════════════════════════════════ */
#folderlist-content a { color: #374151 !important; border-radius: 6px !important; }

#folderlist-content li.selected > a,
#folderlist-content li.selected > div {
    background-color: #D1FAE5 !important;
    color: #065f46 !important;
    font-weight: 600 !important;
}
#folderlist-content li a:hover {
    background-color: #F0FDF4 !important;
}
#folderlist-content .unreadcount {
    background-color: #10B981 !important;
    color: #ffffff !important;
    border-radius: 999px !important;
}

/* ═══════════════════════════════════════════════════════
   7. LISTE DES MESSAGES
═══════════════════════════════════════════════════════ */
#messagelist thead th,
table.listing thead th {
    background-color: #F9FAFB !important;
    color: #6B7280 !important;
    border-bottom: 1px solid #E5E7EB !important;
    font-weight: 500 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
}

table.listing thead th a.sortcol { color: #6B7280 !important; }
table.listing thead th.sorted a.sortcol { color: #10B981 !important; }

table.listing tbody tr td {
    border-bottom: 1px solid #F3F4F6 !important;
    color: #374151 !important;
}

/* Non lu */
table.listing tbody tr.unread td.subject,
table.listing tbody tr.unread td.from,
table.listing tbody tr.unread td.fromto {
    font-weight: 700 !important;
    color: #111827 !important;
}

/* Sélectionné */
table.listing tbody tr.selected td {
    background-color: #D1FAE5 !important;
    color: #065f46 !important;
}
table.listing tbody tr.selected td:first-child {
    box-shadow: inset 3px 0 0 #10B981 !important;
}

/* Hover */
table.listing tbody tr:hover td {
    background-color: #F0FDF4 !important;
}

/* Date / taille */
table.listing td.date,
table.listing td.size {
    color: #9CA3AF !important;
    font-size: 0.78rem !important;
}

/* ═══════════════════════════════════════════════════════
   8. SCROLLBAR
═══════════════════════════════════════════════════════ */
html:not(.touch) ::-webkit-scrollbar { width: 4px !important; height: 4px !important; }
html:not(.touch) ::-webkit-scrollbar-track { background: transparent !important; }
html:not(.touch) ::-webkit-scrollbar-thumb { background-color: rgba(16,185,129,0.3) !important; border-radius: 999px !important; }
html:not(.touch) ::-webkit-scrollbar-thumb:hover { background-color: rgba(16,185,129,0.55) !important; }
html { scrollbar-color: rgba(16,185,129,0.3) transparent !important; }

/* ═══════════════════════════════════════════════════════
   9. FORMULAIRES
═══════════════════════════════════════════════════════ */
input.form-control,
select.form-control,
textarea.form-control,
.custom-select {
    border-color: #E5E7EB !important;
    border-radius: 8px !important;
    color: #1F2937 !important;
    background-color: #ffffff !important;
}
input.form-control:focus,
select.form-control:focus,
textarea.form-control:focus {
    border-color: #10B981 !important;
    box-shadow: 0 0 0 3px rgba(16,185,129,0.15) !important;
    outline: none !important;
}

/* ═══════════════════════════════════════════════════════
   10. PAGE DE LOGIN
═══════════════════════════════════════════════════════ */
body.task-login {
    background:
        radial-gradient(circle at top left, rgba(16,185,129,0.18), transparent 34%),
        radial-gradient(circle at bottom right, rgba(6,78,59,0.24), transparent 30%),
        linear-gradient(135deg, #ecfdf5 0%, #f8fafc 45%, #dcfce7 100%) !important;
    min-height: 100vh !important;
}
body.task-login #layout,
body.task-login #layout-content {
    background: transparent !important;
}
body.task-login #layout {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
    padding: 2rem !important;
}
body.task-login #logo {
    position: static !important;
    display: block !important;
    margin: 0 0 1.25rem !important;
    max-height: 52px !important;
}

#login-shell {
    position: relative !important;
    display: grid !important;
    grid-template-columns: minmax(280px, 1.05fr) minmax(360px, 440px) !important;
    gap: 1.5rem !important;
    width: min(1080px, 100%) !important;
    align-items: stretch !important;
}

#login-shell::before {
    content: "" !important;
    position: absolute !important;
    inset: -24px !important;
    background: linear-gradient(135deg, rgba(255,255,255,0.52), rgba(255,255,255,0.18)) !important;
    border: 1px solid rgba(255,255,255,0.45) !important;
    border-radius: 32px !important;
    box-shadow: 0 30px 80px rgba(6,78,59,0.12) !important;
    backdrop-filter: blur(14px) !important;
    z-index: 0 !important;
}

.login-hero,
.login-panel {
    position: relative !important;
    z-index: 1 !important;
}

.login-hero {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    padding: 3rem !important;
    color: #ecfdf5 !important;
    border-radius: 28px !important;
    background:
        radial-gradient(circle at top right, rgba(110,231,183,0.22), transparent 26%),
        linear-gradient(155deg, #022c22 0%, #064e3b 48%, #0f766e 100%) !important;
    min-height: 620px !important;
    overflow: hidden !important;
}

.login-hero::after {
    content: "" !important;
    position: absolute !important;
    width: 280px !important;
    height: 280px !important;
    right: -60px !important;
    top: -40px !important;
    border-radius: 999px !important;
    background: radial-gradient(circle, rgba(167,243,208,0.2), rgba(167,243,208,0)) !important;
}

.login-hero-badge {
    display: inline-flex !important;
    align-items: center !important;
    width: fit-content !important;
    padding: 0.5rem 0.85rem !important;
    margin-bottom: 1.25rem !important;
    border-radius: 999px !important;
    border: 1px solid rgba(255,255,255,0.16) !important;
    background: rgba(255,255,255,0.08) !important;
    color: #d1fae5 !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
}

.login-hero h2 {
    margin: 0 0 1rem !important;
    color: #ffffff !important;
    font-size: clamp(2.2rem, 4vw, 3.6rem) !important;
    line-height: 0.96 !important;
    letter-spacing: -0.05em !important;
    font-weight: 800 !important;
    max-width: 9ch !important;
}

.login-hero p {
    margin: 0 0 1.5rem !important;
    max-width: 34rem !important;
    color: rgba(236,253,245,0.82) !important;
    font-size: 1rem !important;
    line-height: 1.65 !important;
}

.login-hero-points {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: grid !important;
    gap: 0.75rem !important;
}

.login-hero-points li {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    color: #d1fae5 !important;
    font-size: 0.95rem !important;
}

.login-hero-points li::before {
    content: "" !important;
    width: 10px !important;
    height: 10px !important;
    border-radius: 999px !important;
    background: linear-gradient(135deg, #6ee7b7, #34d399) !important;
    box-shadow: 0 0 0 6px rgba(110,231,183,0.12) !important;
}

.login-panel {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    min-height: 620px !important;
    padding: 2.6rem !important;
    border-radius: 28px !important;
    background: rgba(255,255,255,0.76) !important;
    border: 1px solid rgba(255,255,255,0.62) !important;
    backdrop-filter: blur(18px) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 18px 50px rgba(15,23,42,0.07) !important;
}

.login-panel-copy {
    margin-bottom: 1.25rem !important;
}

.login-panel-copy h2 {
    margin: 0 0 0.5rem !important;
    color: #0f172a !important;
    font-size: 1.9rem !important;
    line-height: 1.05 !important;
    letter-spacing: -0.04em !important;
    font-weight: 750 !important;
}

.login-panel-copy p {
    margin: 0 !important;
    color: #475569 !important;
    line-height: 1.6 !important;
}

#login-form {
    position: static !important;
    background-color: transparent !important;
    border-radius: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    top: auto !important;
    width: 100% !important;
}

#login-form td.title label {
    color: #334155 !important;
    font-weight: 650 !important;
    font-size: 0.82rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
}

#login-form input#rcmloginuser,
#login-form input#rcmloginpwd {
    border: 1px solid #dbe4ee !important;
    border-radius: 14px !important;
    padding: 0.9rem 1rem !important;
    background: rgba(248,250,252,0.88) !important;
    color: #0f172a !important;
    font-size: 0.96rem !important;
    width: 100% !important;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s !important;
}
#login-form input#rcmloginuser:focus,
#login-form input#rcmloginpwd:focus {
    border-color: #10B981 !important;
    box-shadow: 0 0 0 4px rgba(16,185,129,0.14) !important;
    background: #ffffff !important;
    outline: none !important;
}

#login-form table {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 0.95rem !important;
}

#rcmloginsubmit {
    background: linear-gradient(135deg, #10b981 0%, #0f766e 100%) !important;
    border: none !important;
    border-radius: 14px !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 0.96rem !important;
    padding: 0.95rem 1.5rem !important;
    width: 100% !important;
    cursor: pointer !important;
    letter-spacing: 0.01em !important;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s !important;
    margin-top: 0.4rem !important;
    box-shadow: 0 16px 28px rgba(16,185,129,0.22) !important;
}
#rcmloginsubmit:hover {
    opacity: 0.96 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 22px 36px rgba(16,185,129,0.28) !important;
}
#rcmloginsubmit:before { display: none !important; }

#login-footer { color: #94a3b8 !important; font-size: 0.78rem !important; }
#login-footer > div {
    background-color: rgba(15,118,110,0.05) !important;
    border: 1px solid rgba(16,185,129,0.12) !important;
    border-radius: 14px !important;
    color: #64748b !important;
    padding: 0.85rem 1rem !important;
    margin-top: 1.25rem !important;
}

body.task-login .form-control:-webkit-autofill,
body.task-login .form-control:-webkit-autofill:hover,
body.task-login .form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: #0f172a !important;
    -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
}

@media (max-width: 960px) {
    body.task-login #layout {
        padding: 1rem !important;
    }

    #login-shell {
        grid-template-columns: 1fr !important;
    }

    #login-shell::before {
        inset: -10px !important;
        border-radius: 24px !important;
    }

    .login-hero,
    .login-panel {
        min-height: auto !important;
    }

    .login-hero {
        padding: 2rem !important;
    }

    .login-hero h2 {
        max-width: none !important;
        font-size: 2.3rem !important;
    }

    .login-panel {
        padding: 1.6rem !important;
    }
}

@media (max-width: 640px) {
    .login-hero {
        padding: 1.5rem !important;
        border-radius: 22px !important;
    }

    .login-panel {
        border-radius: 22px !important;
    }

    .login-hero-points {
        gap: 0.6rem !important;
    }
}

/* ═══════════════════════════════════════════════════════
   11. VUE MESSAGE
═══════════════════════════════════════════════════════ */
#message-header {
    border-bottom: 1px solid #E5E7EB !important;
}
#message-header .subject {
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    color: #111827 !important;
    letter-spacing: -0.02em !important;
}
#message-header .header-links a {
    color: #6B7280 !important;
    border-radius: 6px !important;
}
#message-header .header-links a:hover {
    background-color: #F0FDF4 !important;
    color: #047857 !important;
}

/* ═══════════════════════════════════════════════════════
   12. MENUS CONTEXTUELS
═══════════════════════════════════════════════════════ */
.popupmenu, .dropdown-menu {
    border-radius: 12px !important;
    border: 1px solid #E5E7EB !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.10) !important;
    overflow: hidden !important;
    padding: 4px !important;
}
.popupmenu li a, .dropdown-menu .dropdown-item {
    border-radius: 6px !important;
    color: #374151 !important;
    font-size: 0.875rem !important;
}
.popupmenu li a:hover, .dropdown-menu .dropdown-item:hover {
    background-color: #F0FDF4 !important;
    color: #047857 !important;
}

/* ═══════════════════════════════════════════════════════
   13. DIALOGS
═══════════════════════════════════════════════════════ */
.ui-dialog {
    border-radius: 16px !important;
    border: 1px solid #E5E7EB !important;
    box-shadow: 0 24px 64px rgba(0,0,0,0.10) !important;
    overflow: hidden !important;
}
.ui-dialog .ui-dialog-titlebar {
    background: linear-gradient(135deg, #10B981 0%, #047857 100%) !important;
    border: none !important;
    padding: 0.85rem 1.25rem !important;
}
.ui-dialog .ui-dialog-titlebar .ui-dialog-title {
    color: #ffffff !important;
    font-weight: 600 !important;
}
.ui-dialog .ui-dialog-buttonpane {
    background-color: #F9FAFB !important;
    border-top: 1px solid #E5E7EB !important;
}

/* ═══════════════════════════════════════════════════════
   14. BOUTONS MAINACTION (Send, Save…)
═══════════════════════════════════════════════════════ */
a.button.mainaction,
button.mainaction,
input.mainaction {
    background-color: #10B981 !important;
    border-color:     #10B981 !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
}
a.button.mainaction:hover,
button.mainaction:hover,
input.mainaction:hover {
    background-color: #059669 !important;
    border-color:     #059669 !important;
}

/* ═══════════════════════════════════════════════════════
   15. FOOTER panels
═══════════════════════════════════════════════════════ */
#layout > div > .footer.small,
.pagenav {
    background-color: #ffffff !important;
    border-top: 1px solid #F3F4F6 !important;
    color: #9CA3AF !important;
    font-size: 0.78rem !important;
}
.pagenav-text { color: #6B7280 !important; }

/* ═══════════════════════════════════════════════════════
   16. SETTINGS
═══════════════════════════════════════════════════════ */
.propform fieldset {
    border: 1px solid #D1FAE5 !important;
    border-radius: 10px !important;
}
.propform fieldset legend {
    color: #047857 !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
}
.tablink.selected, .nav-tabs .nav-link.active {
    color: #059669 !important;
    border-bottom-color: #10B981 !important;
}

/* ═══════════════════════════════════════════════════════
   17. ALERTES
═══════════════════════════════════════════════════════ */
.notice         { background: rgba(16,185,129,0.07)  !important; border-left: 3px solid #10B981 !important; }
.notice.error   { background: rgba(239,68,68,0.07)   !important; border-left: 3px solid #EF4444 !important; }
.notice.warning { background: rgba(245,158,11,0.07)  !important; border-left: 3px solid #F59E0B !important; }

/* ═══════════════════════════════════════════════════════
   18. LOGO — remplace l'image elastic par celle de virtmo
═══════════════════════════════════════════════════════ */
#logo {
    content: url(/skins/virtmo/images/logo.svg) !important;
    max-height: 44px !important;
    width: auto !important;
}
#layout-menu .popover-header img#logo {
    content: url(/skins/virtmo/images/logo.svg) !important;
    max-height: 36px !important;
}
