/* =========================================================
   FEZEKA SSO — Base
   Variables, resets, typography, forms, buttons, alerts,
   utilities and loading states. Loaded on every page.
   ========================================================= */

:root {
    /* Brand */
    --primary: #94356f;
    --primary-dark: #7d2d5f;
    --primary-light: #b85a8f;
    --secondary: #28db2a;
    --secondary-dark: #1fa020;
    --secondary-light: #5ce65a;
    /* Surface */
    --white: #fff;
    --bg: #f8f9fa;
    --bg-soft: #f0f4ff;
    --gray-50: #fafbfc;
    --gray-100: #f0f1f3;
    --gray-200: #e0e2e6;
    --gray-300: #c8cbd1;
    --gray-400: #a8acb5;
    --gray-500: #75787f;
    /* Text */
    --text: #1a1a1a;
    --text-medium: #333;
    --text-light: #666;
    --text-muted: #999;
    /* Borders */
    --border: #e0e0e0;
    --border-light: #f0f0f0;
    --glass-border: rgba(255, 255, 255, .3);
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, .12);
    --shadow-xl: 0 12px 40px rgba(0, 0, 0, .15);
    /* Layout */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    /* Typography */
    --font-mono: "Courier New", Courier, monospace;
}

/* =========================================================
   RESET & BASE
   ========================================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

html,
body {
    min-height: 100%;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    min-height: calc(100vh - 200px);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text);
    font-weight: 700;
    line-height: 1.3;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.3rem;
}

p {
    color: var(--text-light);
    line-height: 1.7;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color .2s ease;
}

    a:hover {
        color: var(--primary-dark);
    }

code {
    font-family: var(--font-mono);
}

/* =========================================================
   FORMS
   ========================================================= */

.form-wrapper {
    width: 100%;
    max-width: 360px;
}

.form-group,
.input-group-login {
    margin-bottom: 1.5rem;
}

    .form-group label,
    .input-group-login label {
        display: block;
        margin-bottom: .5rem;
        color: var(--text);
        font-size: .95rem;
        font-weight: 600;
    }

    .form-group input,
    .form-group select,
    .form-group textarea,
    .input-icon-wrap input,
    .input-icon-wrap select {
        width: 100%;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        outline: none;
        background: var(--white);
        color: var(--text);
        font: inherit;
        font-size: .95rem;
        transition: border-color .2s ease, box-shadow .2s ease;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: .75rem 1rem;
    }

    .form-group input::placeholder,
    .form-group textarea::placeholder {
        color: var(--text-muted);
    }

    .form-group input:focus,
    .form-group select:focus,
    .form-group textarea:focus,
    .input-icon-wrap input:focus,
    .input-icon-wrap select:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(148, 53, 111, .1);
    }

    .form-group textarea {
        min-height: 120px;
        resize: vertical;
    }

    .form-group input[readonly] {
        background: var(--gray-100);
        cursor: not-allowed;
    }

    .form-group input.input-error,
    .form-group select.input-error,
    .form-group textarea.input-error,
    .input-icon-wrap input.input-error {
        border-color: #e74c3c;
    }

.field-error,
.validation-error {
    display: block;
    margin-top: .25rem;
    color: #dc3545;
    font-size: .85rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.5rem 0;
    color: var(--text-light);
    font-size: .95rem;
}

    .form-check input[type="checkbox"],
    .form-check input[type="radio"] {
        width: 18px;
        height: 18px;
        cursor: pointer;
        accent-color: var(--primary);
    }

    .form-check label,
    .checkbox-label {
        margin: 0;
        cursor: pointer;
    }

    .form-check a {
        font-weight: 500;
    }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: .75rem;
}

    .checkbox-label input {
        width: auto;
    }

.form-hint,
small {
    display: block;
    margin-top: .25rem;
    color: var(--text-light);
    font-size: .85rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row-col {
    flex: 1;
}

.inline-form {
    display: inline-block;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: .75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font: inherit;
    font-size: .95rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    transition: all .2s ease;
}

    .btn:hover {
        text-decoration: none;
    }

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

    .btn-primary:hover {
        background: var(--primary-dark);
        color: var(--white);
        box-shadow: 0 5px 20px rgba(148, 53, 111, .25);
        transform: translateY(-2px);
    }

.btn-secondary,
.btn-success {
    background: var(--secondary);
    color: #123b12;
}

    .btn-secondary:hover,
    .btn-success:hover {
        background: var(--secondary-dark);
        color: var(--white);
        box-shadow: 0 5px 20px rgba(40, 219, 42, .25);
        transform: translateY(-2px);
    }

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

    .btn-outline:hover {
        background: var(--primary);
        color: var(--white);
    }

.btn-danger {
    background: transparent;
    color: #e74c3c;
    border-color: #e74c3c;
}

    .btn-danger:hover:not(:disabled) {
        background: #e74c3c;
        color: var(--white);
        box-shadow: 0 4px 12px rgba(231, 76, 60, .25);
        transform: translateY(-2px);
    }

.btn-block {
    width: 100%;
    margin-top: 1rem;
}

.btn-lg {
    padding: .9rem 2rem;
    font-size: 1rem;
}

.btn-sm,
.btn-small {
    padding: .5rem 1rem;
    font-size: .85rem;
}

.btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none !important;
}

/* =========================================================
   ALERTS
   ========================================================= */

.alert {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius);
    border-left: 4px solid;
}

.alert-success {
    background: rgba(40, 219, 42, .08);
    color: #1a6b1a;
    border-left-color: var(--secondary);
}

.alert-danger,
.alert-error,
.alert-delete {
    background: rgba(220, 53, 69, .08);
    color: #721c24;
    border-left-color: #dc3545;
}

.alert-warning {
    background: rgba(255, 193, 7, .08);
    color: #856404;
    border-left-color: #ffc107;
}

.alert-info {
    background: rgba(148, 53, 111, .08);
    color: #4a1a35;
    border-left-color: var(--primary);
}

.alert-delete {
    padding: 1rem;
    font-weight: 500;
}

/* =========================================================
   ANIMATIONS / LOADING STATES
   ========================================================= */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

    .btn-loading::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 18px;
        height: 18px;
        margin: -9px 0 0 -9px;
        border: 2px solid rgba(255, 255, 255, .4);
        border-top-color: #fff;
        border-radius: 50%;
        animation: spinner .7s linear infinite;
    }

.btn-loading.btn-outline::after,
.btn-loading.btn-danger::after {
    border-color: rgba(148, 53, 111, .3);
    border-top-color: var(--primary);
}

/* =========================================================
   UTILITIES
   ========================================================= */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: .5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 2rem;
}

.mt-4 {
    margin-top: 3rem;
}

.mt-5 {
    margin-top: 4rem;
}

.mb-1 {
    margin-bottom: .5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 2rem;
}

.mb-4 {
    margin-bottom: 3rem;
}

.mb-5 {
    margin-bottom: 4rem;
}

.pt-3 {
    padding-top: 2rem;
}

.pb-3 {
    padding-bottom: 2rem;
}

.hidden {
    display: none !important;
}

[hidden] {
    display: none !important;
}

.visible {
    display: block !important;
}

/* =========================================================
   RESPONSIVE — BASE
   ========================================================= */

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
    }

    .btn-lg,
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}

@media (max-width: 480px) {
    h1,
    h2 {
        font-size: 1.4rem;
    }
}

@media (min-width: 2560px) {
    .btn {
        padding: .85rem 1.75rem;
        font-size: 1rem;
    }
}