/**
 * Study Abroad Management Portal - Public Styles
 * Frontend styles for the public-facing portal
 */

/* CSS Variables */
:root {
    --samp-primary: #2563eb;
    --samp-primary-hover: #1d4ed8;
    --samp-secondary: #64748b;
    --samp-success: #22c55e;
    --samp-warning: #f59e0b;
    --samp-danger: #ef4444;
    --samp-info: #0ea5e9;
    --samp-light: #f8fafc;
    --samp-dark: #1e293b;
    --samp-white: #ffffff;
    --samp-gray-100: #f1f5f9;
    --samp-gray-200: #e2e8f0;
    --samp-gray-300: #cbd5e1;
    --samp-gray-400: #94a3b8;
    --samp-gray-500: #64748b;
    --samp-gray-600: #475569;
    --samp-gray-700: #334155;
    --samp-gray-800: #1e293b;
    --samp-gray-900: #0f172a;
    --samp-border-radius: 0.5rem;
    --samp-transition: all 0.2s ease-in-out;
    --samp-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --samp-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --samp-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --samp-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Reset & Base */
.samp-public-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--samp-gray-800);
    background-color: var(--samp-gray-100);
}

.samp-public-wrapper *,
.samp-public-wrapper *::before,
.samp-public-wrapper *::after {
    box-sizing: border-box;
}

/* Auth Container */
.samp-auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--samp-primary) 0%, #1e40af 100%);
}

.samp-auth-box {
    background: var(--samp-white);
    border-radius: var(--samp-border-radius);
    box-shadow: var(--samp-shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 2rem;
}

.samp-auth-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.samp-auth-logo img {
    max-width: 180px;
    height: auto;
}

.samp-auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--samp-primary);
    margin: 0.5rem 0 0;
}

.samp-auth-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--samp-gray-800);
    margin-bottom: 0.5rem;
    text-align: center;
}

.samp-auth-subtitle {
    font-size: 0.875rem;
    color: var(--samp-gray-500);
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Form Styles */
.samp-form-group {
    margin-bottom: 1rem;
}

.samp-form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--samp-gray-700);
    margin-bottom: 0.375rem;
}

.samp-form-label.required::after {
    content: ' *';
    color: var(--samp-danger);
}

.samp-form-control {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--samp-gray-800);
    background-color: var(--samp-white);
    background-clip: padding-box;
    border: 1px solid var(--samp-gray-300);
    border-radius: var(--samp-border-radius);
    transition: var(--samp-transition);
}

.samp-form-control:focus {
    color: var(--samp-gray-800);
    background-color: var(--samp-white);
    border-color: var(--samp-primary);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.samp-form-control::placeholder {
    color: var(--samp-gray-400);
}

.samp-form-control:disabled,
.samp-form-control[readonly] {
    background-color: var(--samp-gray-100);
    opacity: 1;
}

.samp-form-control.is-invalid {
    border-color: var(--samp-danger);
}

.samp-form-control.is-invalid:focus {
    border-color: var(--samp-danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.samp-invalid-feedback {
    display: block;
    font-size: 0.75rem;
    color: var(--samp-danger);
    margin-top: 0.25rem;
}

textarea.samp-form-control {
    min-height: 100px;
    resize: vertical;
}

select.samp-form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Checkbox */
.samp-form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.samp-form-check-input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    border: 1px solid var(--samp-gray-300);
    border-radius: 0.25rem;
    cursor: pointer;
}

.samp-form-check-input:checked {
    background-color: var(--samp-primary);
    border-color: var(--samp-primary);
}

.samp-form-check-label {
    font-size: 0.875rem;
    color: var(--samp-gray-600);
    cursor: pointer;
}

/* Buttons */
.samp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: var(--samp-border-radius);
    transition: var(--samp-transition);
}

.samp-btn:focus {
    outline: none;
}

.samp-btn:disabled,
.samp-btn.disabled {
    opacity: 0.65;
    pointer-events: none;
}

.samp-btn-primary {
    color: var(--samp-white);
    background-color: var(--samp-primary);
    border-color: var(--samp-primary);
}

.samp-btn-primary:hover {
    background-color: var(--samp-primary-hover);
    border-color: var(--samp-primary-hover);
}

.samp-btn-primary:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.samp-btn-secondary {
    color: var(--samp-gray-700);
    background-color: var(--samp-white);
    border-color: var(--samp-gray-300);
}

.samp-btn-secondary:hover {
    background-color: var(--samp-gray-50);
    border-color: var(--samp-gray-400);
}

.samp-btn-success {
    color: var(--samp-white);
    background-color: var(--samp-success);
    border-color: var(--samp-success);
}

.samp-btn-success:hover {
    background-color: #16a34a;
    border-color: #16a34a;
}

.samp-btn-danger {
    color: var(--samp-white);
    background-color: var(--samp-danger);
    border-color: var(--samp-danger);
}

.samp-btn-danger:hover {
    background-color: #dc2626;
    border-color: #dc2626;
}

.samp-btn-link {
    color: var(--samp-primary);
    background-color: transparent;
    border-color: transparent;
}

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

.samp-btn-block {
    display: flex;
    width: 100%;
}

.samp-btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.samp-btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

/* Auth Footer */
.samp-auth-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.samp-auth-footer p {
    font-size: 0.875rem;
    color: var(--samp-gray-600);
    margin: 0;
}

.samp-auth-footer a {
    color: var(--samp-primary);
    text-decoration: none;
}

.samp-auth-footer a:hover {
    text-decoration: underline;
}

.samp-auth-divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}

.samp-auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid var(--samp-gray-200);
}

.samp-auth-divider span {
    position: relative;
    background: var(--samp-white);
    padding: 0 1rem;
    font-size: 0.75rem;
    color: var(--samp-gray-500);
    text-transform: uppercase;
}

/* Alerts */
.samp-alert {
    position: relative;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--samp-border-radius);
    font-size: 0.875rem;
}

.samp-alert-success {
    color: #166534;
    background-color: #dcfce7;
    border-color: #bbf7d0;
}

.samp-alert-danger {
    color: #991b1b;
    background-color: #fee2e2;
    border-color: #fecaca;
}

.samp-alert-warning {
    color: #92400e;
    background-color: #fef3c7;
    border-color: #fde68a;
}

.samp-alert-info {
    color: #075985;
    background-color: #e0f2fe;
    border-color: #bae6fd;
}

/* Card Styles */
.samp-card {
    background: var(--samp-white);
    border: 1px solid var(--samp-gray-200);
    border-radius: var(--samp-border-radius);
    box-shadow: var(--samp-shadow-sm);
}

.samp-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--samp-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.samp-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--samp-gray-800);
    margin: 0;
}

.samp-card-body {
    padding: 1.25rem;
}

.samp-card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--samp-gray-200);
    background-color: var(--samp-gray-50);
}

/* Password Strength Indicator */
.samp-password-strength {
    margin-top: 0.5rem;
}

.samp-password-strength-bar {
    height: 4px;
    border-radius: 2px;
    background-color: var(--samp-gray-200);
    overflow: hidden;
}

.samp-password-strength-fill {
    height: 100%;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.samp-password-strength-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.strength-weak .samp-password-strength-fill {
    width: 25%;
    background-color: var(--samp-danger);
}

.strength-fair .samp-password-strength-fill {
    width: 50%;
    background-color: var(--samp-warning);
}

.strength-good .samp-password-strength-fill {
    width: 75%;
    background-color: var(--samp-info);
}

.strength-strong .samp-password-strength-fill {
    width: 100%;
    background-color: var(--samp-success);
}

/* OTP Input */
.samp-otp-container {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.samp-otp-input {
    width: 3rem;
    height: 3rem;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    border: 2px solid var(--samp-gray-300);
    border-radius: var(--samp-border-radius);
    transition: var(--samp-transition);
}

.samp-otp-input:focus {
    border-color: var(--samp-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* Loading State */
.samp-loading {
    position: relative;
    pointer-events: none;
}

.samp-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.samp-spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--samp-gray-300);
    border-radius: 50%;
    border-top-color: var(--samp-primary);
    animation: samp-spin 0.8s linear infinite;
}

@keyframes samp-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 640px) {
    .samp-auth-container {
        padding: 1rem;
    }
    
    .samp-auth-box {
        padding: 1.5rem;
    }
    
    .samp-otp-input {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }
}

/* Utility Classes */
.samp-text-center {
    text-align: center;
}

.samp-text-right {
    text-align: right;
}

.samp-text-muted {
    color: var(--samp-gray-500);
}

.samp-mt-1 { margin-top: 0.25rem; }
.samp-mt-2 { margin-top: 0.5rem; }
.samp-mt-3 { margin-top: 1rem; }
.samp-mt-4 { margin-top: 1.5rem; }

.samp-mb-1 { margin-bottom: 0.25rem; }
.samp-mb-2 { margin-bottom: 0.5rem; }
.samp-mb-3 { margin-bottom: 1rem; }
.samp-mb-4 { margin-bottom: 1.5rem; }

.samp-d-flex { display: flex; }
.samp-justify-between { justify-content: space-between; }
.samp-align-center { align-items: center; }
.samp-gap-2 { gap: 0.5rem; }
.samp-gap-3 { gap: 1rem; }
