@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;600;700&display=swap');

* {
    font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    outline: none;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

/* Header Styles */
.top {
    width: 100%;
    background: linear-gradient(135deg, #153c3f 0%, #1a4d52 100%);
    color: white;
    padding: 15px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top a {
    color: white;
    text-decoration: none;
    margin-left: 40px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
}

.top a:hover {
    transform: translateY(-2px);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Divider */
.divider {
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #00C8E1 0%, #197185 50%, #146E82 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Header Container */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.header-left {
    flex: 1;
}

.header-right {
    flex: 1;
    text-align: right;
}

.header-right img {
    max-width: 120px;
    height: auto;
    transition: transform 0.3s ease;
}

.header-right img:hover {
    transform: scale(1.05);
}

/* Exit Button */
.exit-btn {
    background: linear-gradient(135deg, #146E82 0%, #0f4a57 100%);
    border: none;
    color: white;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(20, 110, 130, 0.3);
}

.exit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 110, 130, 0.4);
    background: linear-gradient(135deg, #0f4a57 0%, #0a2f36 100%);
}

.exit-btn:active {
    transform: translateY(0);
}

/* Info Card */
.info-card {
    display: inline-block;
    width: 600px;
    max-width: 100%;
    color: #3e3e3e;
    text-align: right;
    background: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 30px;
    margin: 20px auto;
    transition: all 0.3s ease;
    border-top: 4px solid #00C8E1;
}

.info-card:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.info-card h2 {
    margin: 0 0 20px 0;
    color: #153c3f;
    font-size: 1.5em;
    font-weight: 700;
}

.info-table {
    width: 100%;
    text-align: right;
    border-collapse: collapse;
}

.info-table th {
    color: #146E82;
    font-weight: 700;
    padding: 12px;
    border-bottom: 2px solid #e0e0e0;
    text-align: right;
}

.info-table td {
    padding: 12px;
    color: #555;
    font-weight: 500;
    border-bottom: 1px solid #f0f0f0;
}

/* Main Content Container */
.main-content {
    text-align: center;
    width: 100%;
    padding: 20px 0 100px 0;
}

/* Form Card */
.form-card {
    display: inline-block;
    width: 600px;
    max-width: 100%;
    color: #3e3e3e;
    background: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 40px;
    margin: 20px auto;
    transition: all 0.3s ease;
    border-top: 4px solid #197185;
}

.form-card:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.form-card h2 {
    margin: 0 0 10px 0;
    color: #153c3f;
    font-size: 1.4em;
    font-weight: 700;
}

.form-card form {
    text-align: right;
}

/* Error Message */
.error-message {
    color: #e74c3c;
    background: #fadbd8;
    padding: 12px 15px;
    border-radius: 6px;
    margin: 15px 0;
    border-left: 4px solid #e74c3c;
    font-weight: 500;
}

/* Form Fields */
.fld {
    width: 100%;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
}

.fld div {
    width: 100%;
}

.fld.flex-row {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.fld.flex-row > div {
    flex: 1;
}

/* Text Input */
.textinput {
    width: 100%;
    border: 2px solid #e0e0e0;
    padding: 14px 16px;
    text-align: right;
    font-size: 1em;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #f9f9f9;
    color: #333;
}

.textinput:focus {
    border-color: #00C8E1;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 200, 225, 0.1);
    transform: translateY(-2px);
}

.textinput::placeholder {
    color: #999;
    font-weight: 400;
}

/* Select Dropdown */
.select {
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    color: #333;
    border-radius: 8px;
    text-align: right;
    font-size: 1em;
    font-weight: 500;
    background: #f9f9f9;
    transition: all 0.3s ease;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-left: 30px;
}

.select:focus {
    border-color: #00C8E1;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(0, 200, 225, 0.1);
    transform: translateY(-2px);
}

.select option {
    background: white;
    color: #333;
    padding: 10px;
}

/* Phone Input Container */
.phone-input-container {
    display: flex;
    align-items: center;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #f9f9f9;
    transition: all 0.3s ease;
    padding: 0;
    /* Change flex direction to row-reverse for RTL layout */
    flex-direction: row-reverse; 
}

.phone-input-container:focus-within .phone-country-code {
    background: white;
}

.phone-input-container:focus-within {
    border-color: #00C8E1;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 200, 225, 0.1);
}

.phone-country-code {
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-left: 2px solid #e0e0e0; /* Add separator to the left */
    min-width: 100px; /* Increase min-width for better look */
    color: #333;
    font-weight: 600;
    /* Remove background and border to eliminate the "empty rectangle" */
    background: transparent; 
    border-right: none;
}

.phone-country-code img {
    width: 24px;
    height: 16px;
    margin: 0 6px;
    border-radius: 2px;
}

.phone-input-field {
    flex: 1;
    padding: 14px 16px;
    border: none;
    background: none;
    text-align: right; /* Align text to the right for RTL placeholder */
    font-size: 1em;
    font-weight: 500;
    color: #333;
}

.phone-input-field:focus {
    outline: none;
}

.phone-input-field::placeholder {
    color: #999;
}

/* Submit Button */
.submit-btn {
    background: linear-gradient(135deg, #00C8E1 0%, #00a8c1 100%);
    border: none;
    font-weight: 700;
    font-size: 1.1em;
    padding: 14px 40px;
    color: #153c3f;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 200, 225, 0.3);
    margin-top: 20px;
    width: 100%;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 200, 225, 0.4);
    background: linear-gradient(135deg, #00a8c1 0%, #0088a1 100%);
}

.submit-btn:active {
    transform: translateY(-1px);
}

/* Footer */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    font-size: 0.85em;
    text-align: center;
    padding: 15px 10px;
    background: linear-gradient(135deg, #153c3f 0%, #0f2a2d 100%);
    color: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

footer div {
    margin: 5px 0;
    line-height: 1.6;
}

footer a {
    color: #00C8E1;
    text-decoration: none;
    transition: all 0.3s ease;
}

footer a:hover {
    text-decoration: underline;
    color: #00e8ff;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }

    .header-left,
    .header-right {
        width: 100%;
        text-align: center;
    }

    .header-right {
        text-align: center;
    }

    .header-right img {
        max-width: 100px;
    }

    .info-card,
    .form-card {
        width: 90%;
        padding: 25px;
        margin: 15px auto;
    }

    /* Fix for Expiry Date on Mobile */
    .fld.flex-row {
        flex-direction: row; /* Keep them side-by-side */
        gap: 10px;
    }

    .fld.flex-row > div {
        width: 50%; /* Make them take half width */
    }

    .phone-country-code {
        min-width: 70px;
        padding: 0 10px;
    }

    .phone-country-code {
        min-width: 70px;
        padding: 0 10px;
    }

    .top a {
        margin-left: 0;
        display: block;
        margin: 5px 0;
    }

    footer {
        font-size: 0.75em;
        padding: 12px 8px;
    }

    .main-content {
        padding: 15px 0 120px 0;
    }
}

@media (max-width: 480px) {
    .info-card,
    .form-card {
        width: 95%;
        padding: 20px;
        border-radius: 10px;
    }

    .form-card h2 {
        font-size: 1.2em;
    }

    .textinput,
    .select,
    .phone-input-container {
        font-size: 16px;
        padding: 12px 14px;
    }

    .submit-btn {
        padding: 12px 20px;
        font-size: 1em;
    }

    .info-table th,
    .info-table td {
        padding: 8px;
        font-size: 0.9em;
    }

    footer {
        font-size: 0.7em;
    }

    .main-content {
        padding: 10px 0 110px 0;
    }
}

/* Loading Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.loader {
    animation: spin 1s linear infinite;
}

/* Smooth Transitions */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

button,
input,
select {
    transition: all 0.3s ease;
}
