/* Dresium Theme - Custom HTML Templates */
/* Design basato su screenshot */
/* Cache bust: 2026-03-05-v2 */

/* Variables */
:root {
    --dresium-primary: #4c6ef5;
    --dresium-primary-dark: #4362DB;
    --dresium-purple: #8B5CF6;
    --dresium-gradient: linear-gradient(90deg, #6366F1 0%, #8B5CF6 100%);
    --dresium-text: #1F2937;
    --dresium-text-light: #A8A8A8;
    --dresium-background: #EEF2FF;
    --dresium-card-bg: #ffffff;
    --dresium-input-bg: #F5F6FA;
    --dresium-border: #A8A8A8;
    --dresium-border-light: #F3F4F6;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a {
    text-decoration: none !important;
}

/* Body */
body.dresium-login {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--dresium-background) url('../img/keycloak-background.png') no-repeat center bottom;
    background-size: cover;
    background-attachment: fixed;
    color: var(--dresium-text);
    min-height: 100vh;
    display: block;
    padding: 32px 12px 12px 12px;
    overflow-y: scroll;
}

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

/* Card */
.dresium-card {
    background: var(--dresium-card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 20px 20px;
}

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

.dresium-logo-img {
    max-width: 140px;
    height: auto;
}

/* Title */
.dresium-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--dresium-text);
    text-align: center;
    margin: 0 0 16px 0;
}

/* Subtitle */
.dresium-subtitle {
    font-size: 13px;
    font-weight: 400;
    color: var(--dresium-text-light);
    text-align: center;
    margin: -10px 0 16px 0;
}

/* Form Group */
.dresium-form-group {
    width: 100%;
    margin-bottom: 8px;
}

/* Input */
.dresium-input {
    width: 100%;
    min-height: 40px;
    background: var(--dresium-input-bg);
    border: 1px solid var(--dresium-border);
    border-width: 0px 0px 0px 0px;
    border-radius: 8px 8px 8px 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: var(--dresium-text);
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dresium-input::placeholder {
    color: #a0a1a2;
}

.dresium-input:focus {
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.1);
    /* border-color: var(--dresium-primary); */
    outline: 0;
}

.dresium-input[aria-invalid="true"] {
    border-color: #EF4444;
    background: #FEF2F2;
}

/* Checkbox */
.dresium-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dresium-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--dresium-primary);
}

.dresium-checkbox label {
    font-size: 14px;
    font-weight: 400;
    color: var(--dresium-text);
    cursor: pointer;
}

/* Form Options (Remember Me / Forgot Password) */
.dresium-form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 8px 0 12px 0;
}

/* Buttons */
.dresium-button {
    width: 100%;
    min-height: 40px;
    border: none;
    border-style: solid;
    border-width: 2px 2px 2px 2px;
    border-radius: 8px 8px 8px 8px;
    padding: 8px 16px 8px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    text-decoration: none;
    display: flex;
    text-align: center;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.dresium-button--primary {
    background: var(--dresium-primary);
    color: white;
}

.dresium-button--primary:hover {
    background: var(--dresium-primary-dark);
}

.dresium-button--gradient {
    background: var(--dresium-gradient);
    color: white;
}

.dresium-button--gradient:hover {
    opacity: 0.9;
}

/* Links */
.dresium-link {
    color: var(--dresium-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.dresium-link:hover {
    color: var(--dresium-primary-dark);
    text-decoration: underline;
}

.dresium-link--small {
    font-size: 13px;
}

/* Divider */
.dresium-divider {
    position: relative;
    text-align: center;
    margin: 32px 0;
}

.dresium-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--dresium-border);
}

.dresium-divider span {
    position: relative;
    background: var(--dresium-card-bg);
    padding: 0 16px;
    font-size: 13px;
    color: var(--dresium-text-light);
}

/* Social Buttons */
.dresium-social {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dresium-social-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 16px 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid var(--dresium-border);
    background: white;
    color: var(--dresium-text);
}

.dresium-social-button:hover {
    background: var(--dresium-input-bg);
    border-color: #D1D5DB;
}

.dresium-social-icon {
    flex-shrink: 0;
}

.dresium-social-button--google {
    /* Google specific styles - white bg with border */
}

.dresium-social-button--apple {
    background: #000000;
    color: white;
    border: none;
}

.dresium-social-button--apple:hover {
    background: #1a1a1a;
}

.dresium-social-button--apple .dresium-social-icon {
    color: white;
}

/* Social Terms Notice */
.dresium-social-terms {
    font-size: 12px;
    color: var(--dresium-text-light);
    text-align: center;
    margin-top: 16px;
    line-height: 1.4;
}

.dresium-social-terms a {
    color: var(--dresium-primary);
    text-decoration: none;
}

.dresium-social-terms a:hover {
    text-decoration: underline;
}

/* Switch (Login/Register toggle) */
.dresium-switch {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--dresium-border);
    text-align: center;
}

.dresium-switch--no-border {
    border-top: none;
    padding-top: 8px;
}

.dresium-switch__text {
    font-size: 13px;
    font-weight: 500;
    color: var(--dresium-text);
    margin-bottom: 8px;
}

/* Alerts */
.dresium-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.4;
}

.dresium-alert span {
    font-size: 16px;
    flex-shrink: 0;
}

.dresium-alert--error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.dresium-alert--success {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.dresium-alert--warning {
    background: #FFFBEB;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.dresium-alert--info {
    background: #EFF6FF;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

/* OAuth Grant Scopes */
.dresium-oauth-scopes {
    background: var(--dresium-input-bg);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.dresium-oauth-scopes h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--dresium-text);
    margin: 0 0 12px 0;
}

.dresium-scopes-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dresium-scope-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--dresium-border);
}

.dresium-scope-item:last-child {
    border-bottom: none;
}

.dresium-scope-icon {
    font-size: 14px;
    color: var(--dresium-primary);
    flex-shrink: 0;
}

.dresium-scope-name {
    font-size: 14px;
    color: var(--dresium-text);
}

/* Form Actions (Multiple Buttons) */
.dresium-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.dresium-form-actions .dresium-button {
    width: 50%;
}

.dresium-button--secondary {
    background: white;
    color: var(--dresium-text);
    border: 1px solid var(--dresium-border);
}

.dresium-button--secondary:hover {
    background: var(--dresium-input-bg);
    border-color: #D1D5DB;
}

/* Hint Text */
.dresium-hint {
    font-size: 12px;
    color: var(--dresium-text-light);
    margin: 8px 0 16px 0;
    line-height: 1.5;
}

/* Responsive */
@media (max-width: 480px) {
    body.dresium-login {
        padding: 12px;
    }

    .dresium-card {
        padding: 20px 16px;
        border-radius: 10px;
    }

    .dresium-logo-img {
        max-width: 120px;
    }

    .dresium-title {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .dresium-subtitle {
        font-size: 12px;
        margin-bottom: 12px;
    }

    .dresium-input {
        padding: 8px 12px;
        font-size: 13px;
    }

    .dresium-button {
        padding: 8px 16px;
        font-size: 12px;
    }

    .dresium-form-group {
        width: 100%;
        /* margin-bottom: 8px; */
    }

    .dresium-divider {
        margin: 24px 0;
    }

    .dresium-social {
        gap: 6px;
    }

    .dresium-social-button {
        padding: 8px 16px;
        font-size: 12px;
    }

    .dresium-switch {
        margin-top: 24px;
        padding-top: 24px;
    }

    .dresium-form-actions {
        flex-direction: column;
    }

    .dresium-form-actions .dresium-button {
        width: 100%;
    }
}


/** RG-WEBDEV **/

#kc-form-login {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

div.dresium-form-group > div.dresium-checkbox {
    margin: 20px 0;
}

#kc-reset-password-form > div.dresium-form-group {
    margin-bottom: 15px;
}