﻿/* Start Fonts */
@font-face {
    font-family: "Kufi";
    src: url("../fonts/KUF.ttf") format("truetype");
    font-weight: normal;
    font-display: swap;
}

@font-face {
    font-family: "Tajawal";
    src: url("../fonts/Tajawal-Regular.ttf") format("truetype");
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Tajawal";
    src: url("../fonts/Tajawal-Medium.ttf") format("truetype");
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: "Tajawal";
    src: url("../fonts/Tajawal-Bold.ttf") format("truetype");
    font-weight: 700;
    font-display: swap;
}
/* End Fonts */

/* Start Variables */
:root {
    --blue-900: #0b2f4e;
    --blue-700: #14507f;
    --blue-500: #1f74b8;
    --teal-500: #12a39a;
    --teal-300: #5fd0c5;
    --teal-50: #e3f6f4;
    --ink: #163047;
    --muted: #5d7488;
    --line: #d5e2ea;
    --surface: #ffffff;
    --page: #f3f8fa;
    --success: #1f8f5f;
    --danger: #c0392b;
    --radius-sm: 6px;
    --radius-lg: 14px;
}
/* End Variables */

/* Start Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Tajawal", Tahoma, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background-color: var(--surface);
}

    body.modal-open {
        overflow: hidden;
    }

input,
button,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
}

h1,
h2,
h3 {
    font-family: "Kufi", "Tajawal", sans-serif;
    font-weight: normal;
}
/* End Reset */

/* Start Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

    .modal[hidden] {
        display: none;
    }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(11, 47, 78, 0.55);
}

.modal-dialog {
    position: relative;
    width: 100%;
    max-width: 340px;
    padding: 32px 24px 24px;
    border-radius: var(--radius-lg);
    background-color: var(--surface);
    text-align: center;
    box-shadow: 0 20px 50px rgba(11, 47, 78, 0.25);
    animation: modal-in 0.18s ease-out;
}

.modal-icon {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

    .modal-icon [hidden] {
        display: none;
    }

.spinner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 5px solid var(--teal-50);
    border-top-color: var(--blue-500);
    border-right-color: var(--teal-500);
    animation: spin 0.8s linear infinite;
}

.modal-icon-success {
    font-size: 56px;
    color: var(--success);
}

.modal-icon-error {
    font-size: 56px;
    color: var(--danger);
}

.modal-message {
    margin: 0 0 20px;
    font-size: 17px;
    font-weight: 500;
}

.modal-close {
    min-width: 120px;
    height: 42px;
    border: 0;
    border-radius: var(--radius-sm);
    background-color: var(--blue-700);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

    .modal-close:hover {
        background-color: var(--blue-500);
    }

.modal.is-loading .modal-close {
    display: none;
}

.modal.is-loading .modal-message {
    margin-bottom: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation-duration: 1.6s;
    }

    .modal-dialog {
        animation: none;
    }
}
/* End Modal */
/* Start Utilities */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
/* End Utilities */

/* Start Form Controls */
.form-field {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background-color: var(--page);
    color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

    .form-input:focus {
        outline: none;
        border-color: var(--teal-500);
        background-color: var(--surface);
        box-shadow: 0 0 0 3px rgba(18, 163, 154, 0.18);
    }
/* End Form Controls */

/* Start Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s;
}

    .btn:focus-visible {
        outline: 3px solid var(--teal-300);
        outline-offset: 2px;
    }

.btn-primary {
    background-color: var(--blue-700);
    color: #ffffff;
}

    .btn-primary:hover {
        background-color: var(--blue-500);
    }

.btn-secondary {
    border: 1px solid var(--line);
    background-color: var(--page);
    color: var(--ink);
}

    .btn-secondary:hover {
        background-color: var(--line);
    }

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
}

    .btn-danger:hover {
        background-color: #a93226;
    }
/* End Buttons */

/* Start Dialog */
.dialog {
    position: fixed;
    inset: 0;
    z-index: 990;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

    .dialog[hidden] {
        display: none;
    }

.dialog-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(11, 47, 78, 0.45);
}

.dialog-box {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px));
    border-radius: 20px 20px 0 0;
    background-color: var(--surface);
    box-shadow: 0 -10px 40px rgba(11, 47, 78, 0.2);
    animation: dialog-up 0.25s ease-out;
}

.dialog-title {
    margin: 0 0 6px;
    font-size: 21px;
    color: var(--blue-900);
}

.dialog-text {
    margin: 0 0 18px;
    color: var(--muted);
}

.dialog-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

    .dialog-actions .btn {
        flex: 1;
    }

@keyframes dialog-up {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (min-width: 600px) {
    .dialog {
        align-items: center;
        padding: 24px;
    }

    .dialog-box {
        border-radius: var(--radius-lg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .dialog-box {
        animation: none;
    }
}
/* End Dialog */
