/* ====== WRAPPER / LAYOUT ====== */

.hexssl-tool {
    max-width: 880px;
    margin: 40px auto;
    padding: 32px;
    border-radius: 18px;
    border: 1px solid;
    box-shadow: 0 14px 40px rgba(0,0,0,0.35);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    transition: background .25s ease, border-color .25s ease, color .25s ease, box-shadow .25s ease;
    position: relative;
    overflow: hidden;
}

.hexssl-tool-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
}

/* ====== THEMES ====== */

.hexssl-theme-dark {
    background: radial-gradient(circle at top left, #2b2b2b 0, #181818 45%, #101010 100%);
    border-color: #2e2e2e;
    color: #e6e6e6;
}

.hexssl-theme-light {
    background: #ffffff;
    border-color: #dcdcdc;
    color: #222222;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

/* ====== HEADLINE / INTRO ====== */

.hexssl-tool h2 {
    margin: 0 0 6px 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #00BCD4;
}

.hexssl-theme-light h2 {
    color: #0097A7;
}

.hexssl-intro {
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 22px 0;
    color: #adadad;
}

.hexssl-theme-light .hexssl-intro {
    color: #555555;
}

/* ====== THEME SWITCHER ====== */

.hexssl-theme-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    white-space: nowrap;
}

.hexssl-theme-label {
    font-size: 12px;
    opacity: 0.8;
}

.hexssl-theme-btn {
    border-radius: 999px;
    border: 1px solid #444;
    background: transparent;
    color: inherit;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    opacity: 0.85;
    transition: background .15s ease, border-color .15s ease, opacity .15s ease, transform .1s ease;
}

.hexssl-theme-btn:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.hexssl-theme-btn.is-active {
    background: linear-gradient(135deg, #00BCD4, #81d742);
    border-color: transparent;
    color: #ffffff;
    opacity: 1;
}

/* ====== FORM ELEMENTS ====== */

.hexssl-form {
    margin-top: 10px;
}

.hexssl-tool label {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    display: block;
}

/* Ikonki przy labelach */
.hexssl-label-cert,
.hexssl-label-format,
.hexssl-label-key,
.hexssl-label-password {
    position: relative;
    padding-left: 22px;
}

.hexssl-label-cert::before,
.hexssl-label-format::before,
.hexssl-label-key::before,
.hexssl-label-password::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 14px;
    height: 14px;
    transform: translateY(-50%);
    border-radius: 4px;
    opacity: 0.85;
}

/* różnicujemy ikonki minimalnie kolorami */
.hexssl-label-cert::before {
    background: radial-gradient(circle at 30% 30%, #00BCD4, #006064);
}

.hexssl-label-format::before {
    background: radial-gradient(circle at 30% 30%, #81d742, #33691e);
}

.hexssl-label-key::before {
    background: radial-gradient(circle at 30% 30%, #FFB300, #FF6F00);
}

.hexssl-label-password::before {
    background: radial-gradient(circle at 30% 30%, #AB47BC, #6A1B9A);
}

/* Inputs / selects / textareas */

.hexssl-tool textarea,
.hexssl-tool select,
.hexssl-tool input[type="text"],
.hexssl-tool input[type="password"] {
    width: 100%;
    padding: 13px 15px;
    margin-bottom: 18px;
    border-radius: 10px;
    border: 1px solid;
    font-size: 13px;
    outline: none;
    font-family: "JetBrains Mono", "Fira Code", "Courier New", monospace;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

/* Dark theme fields */
.hexssl-theme-dark textarea,
.hexssl-theme-dark select,
.hexssl-theme-dark input[type="text"],
.hexssl-theme-dark input[type="password"] {
    background: #252525;
    border-color: #3b3b3b;
    color: #e0e0e0;
}

.hexssl-theme-dark textarea:focus,
.hexssl-theme-dark select:focus,
.hexssl-theme-dark input[type="text"]:focus,
.hexssl-theme-dark input[type="password"]:focus {
    border-color: #00BCD4;
    background: #202020;
    box-shadow: 0 0 0 1px rgba(0,188,212,0.35);
}

/* Light theme fields */
.hexssl-theme-light textarea,
.hexssl-theme-light select,
.hexssl-theme-light input[type="text"],
.hexssl-theme-light input[type="password"] {
    background: #f7f7f7;
    border-color: #cfcfcf;
    color: #222222;
}

.hexssl-theme-light textarea:focus,
.hexssl-theme-light select:focus,
.hexssl-theme-light input[type="text"]:focus,
.hexssl-theme-light input[type="password"]:focus {
    border-color: #00BCD4;
    background: #ffffff;
    box-shadow: 0 0 0 1px rgba(0,188,212,0.25);
}

/* ====== BUTTONS ====== */

.hexssl-btn {
    background: linear-gradient(135deg, #00BCD4, #0097a7);
    color: #ffffff;
    padding: 13px 30px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .3px;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
    box-shadow: 0 6px 22px rgba(0,188,212,0.35);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hexssl-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(0,188,212,0.55);
    filter: brightness(1.05);
}

.hexssl-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(0,188,212,0.35);
}

.hexssl-btn-secondary {
    margin-top: 14px;
    background: linear-gradient(135deg, #424242, #303030);
    box-shadow: 0 4px 18px rgba(0,0,0,0.35);
}

.hexssl-theme-light .hexssl-btn-secondary {
    background: linear-gradient(135deg, #ececec, #d4d4d4);
    color: #222;
    box-shadow: 0 3px 14px rgba(0,0,0,0.12);
}

/* ====== RESULT BOX ====== */

.hexssl-result {
    margin-top: 30px;
    padding: 20px;
    border-radius: 14px;
    border: 1px solid;
}

.hexssl-theme-dark .hexssl-result {
    background: #232323;
    border-color: #323232;
}

.hexssl-theme-light .hexssl-result {
    background: #fafafa;
    border-color: #e0e0e0;
}

.hexssl-result h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #81d742;
}

.hexssl-theme-light .hexssl-result h3 {
    color: #558b2f;
}

.hexssl-result textarea {
    min-height: 220px;
    margin-bottom: 10px;
}

/* ====== ERROR BOX ====== */

.hexssl-error {
    margin-top: 18px;
    margin-bottom: 18px;
    padding: 11px 14px;
    border-radius: 10px;
    font-size: 13px;
    border: 1px solid;
}

.hexssl-theme-dark .hexssl-error {
    background: rgba(255, 78, 78, 0.11);
    border-color: rgba(255, 78, 78, 0.32);
    color: #ff8383;
}

.hexssl-theme-light .hexssl-error {
    background: #ffebee;
    border-color: #ffcdd2;
    color: #c62828;
}

/* ====== DOWNLOAD HINT ====== */

.hexssl-download-hint {
    margin: 8px 0 0 0;
    font-size: 12px;
    opacity: 0.8;
}

/* ====== RESPONSIVE ====== */

@media (max-width: 700px) {
    .hexssl-tool {
        margin: 24px auto;
        padding: 22px;
    }

    .hexssl-tool-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .hexssl-theme-switch {
        align-self: flex-end;
    }

    .hexssl-btn {
        width: 100%;
        justify-content: center;
    }

    .hexssl-btn-secondary {
        width: 100%;
        justify-content: center;
    }
}
