/* ═══════════════════════════════════════════════════════════
   Access System Styles — ETSYS English Exam Platform
   Corporate Colors: Primary #035aa6 | Accent #dc1e5a
   ═══════════════════════════════════════════════════════════ */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f4f8;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* ─── Container ─── */
.access-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 520px;
    padding: 40px 35px;
    position: relative;
}

/* ─── Header ─── */
.access-header {
    text-align: center;
    margin-bottom: 30px;
}

.access-header .logo {
    max-width: 220px;
    height: auto;
    margin-bottom: 12px;
}

.access-header h1 {
    color: #035aa6;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.access-header p {
    color: #666;
    font-size: 14px;
}

/* ─── Info Banner ─── */
.info-banner {
    background: #e8f0fe;
    border-left: 4px solid #035aa6;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 25px;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.info-icon {
    color: #035aa6;
    font-size: 20px;
    flex-shrink: 0;
}

/* ─── Flash Message ─── */
.flash-message {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
}

/* ─── Form ─── */
.access-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.form-group input {
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    outline: none;
    width: 100%;
}

.form-group input:focus {
    border-color: #035aa6;
    box-shadow: 0 0 0 3px rgba(3, 90, 166, 0.1);
}

.form-group input::placeholder {
    color: #aaa;
    font-size: 14px;
}

/* ─── Phone Group (Country Code + Number) ─── */
.phone-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.country-code-select {
    flex: 0 0 120px;
    padding: 12px 8px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.country-code-select:focus {
    border-color: #035aa6;
    box-shadow: 0 0 0 3px rgba(3, 90, 166, 0.1);
}

.phone-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    outline: none;
}

.phone-input:focus {
    border-color: #035aa6;
    box-shadow: 0 0 0 3px rgba(3, 90, 166, 0.1);
}

/* ─── Radio Cards ─── */
.radio-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-card {
    cursor: pointer;
    display: block;
}

.radio-card input[type="radio"] {
    display: none;
}

.radio-card-content {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
    transition: all 0.25s ease;
    position: relative;
}

.radio-card:hover .radio-card-content {
    border-color: #035aa6;
    background: #f4f8ff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(3, 90, 166, 0.08);
}

.radio-card input[type="radio"]:checked + .radio-card-content {
    border-color: #035aa6;
    background: #eef5ff;
    box-shadow: 0 0 0 3px rgba(3, 90, 166, 0.12), 0 3px 10px rgba(3, 90, 166, 0.08);
}

.radio-card-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f4f8;
    border-radius: 10px;
    flex-shrink: 0;
    transition: background 0.25s ease;
}

.radio-card input[type="radio"]:checked + .radio-card-content .radio-card-icon {
    background: #035aa6;
}

.radio-card-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.radio-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    transition: color 0.25s ease;
}

.radio-card input[type="radio"]:checked + .radio-card-content .radio-card-title {
    color: #035aa6;
}

.radio-card-desc {
    font-size: 13px;
    color: #777;
    line-height: 1.3;
    transition: color 0.25s ease;
}

.radio-card input[type="radio"]:checked + .radio-card-content .radio-card-desc {
    color: #555;
}

.radio-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #ccc;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    position: relative;
}

.radio-check::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: transparent;
    transition: all 0.25s ease;
    transform: scale(0);
}

.radio-card input[type="radio"]:checked + .radio-card-content .radio-check {
    border-color: #035aa6;
    background: #035aa6;
}

.radio-card input[type="radio"]:checked + .radio-card-content .radio-check::after {
    background: #fff;
    transform: scale(1);
}

/* ─── Other Test Input ─── */
.other-test-group {
    margin-top: 10px;
}

.other-test-group label {
    font-size: 13px;
    color: #555;
    margin-bottom: 4px;
    display: block;
}

.other-test-input {
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    outline: none;
    width: 100%;
}

.other-test-input:focus {
    border-color: #035aa6;
    box-shadow: 0 0 0 3px rgba(3, 90, 166, 0.1);
}

/* ─── Test Select (Dropdown for target test) ─── */
.test-select {
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='2' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    width: 100%;
}

.test-select:focus {
    border-color: #035aa6;
    box-shadow: 0 0 0 3px rgba(3, 90, 166, 0.1);
}

/* ─── Buttons ─── */
.btn-submit {
    background: #035aa6;
    color: #ffffff;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    text-align: center;
}

.btn-submit:hover {
    background: #024a8a;
}

.btn-submit:active {
    background: #013a6e;
}

.btn-secondary {
    display: inline-block;
    background: #6c757d;
    color: #ffffff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.3s ease;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: #dc1e5a;
}

.btn-danger:hover {
    background: #b8184a;
}

.btn-small {
    background: #035aa6;
    color: #ffffff;
    border: none;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
    white-space: nowrap;
}

.btn-small:hover {
    background: #024a8a;
}

.btn-link {
    background: none;
    border: none;
    color: #035aa6;
    text-decoration: underline;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
}

.btn-link:hover {
    color: #dc1e5a;
}

/* ─── Admin Link ─── */
.admin-link {
    text-align: center;
    margin-top: 20px;
}

.admin-link a {
    color: #999;
    font-size: 13px;
    text-decoration: none;
}

.admin-link a:hover {
    color: #035aa6;
    text-decoration: underline;
}

/* ─── Resend Section ─── */
.resend-section {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.resend-section p {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

/* ─── Success Card ─── */
.success-card {
    text-align: center;
    padding: 30px 20px;
}

.success-icon {
    font-size: 64px;
    color: #28a745;
    margin-bottom: 15px;
}

.success-card h2 {
    color: #035aa6;
    font-size: 22px;
    margin-bottom: 12px;
}

.success-card p {
    color: #555;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 6px;
}

.success-note {
    color: #28a745;
    font-weight: 600;
}

.warning-note {
    color: #dc1e5a;
    font-size: 13px;
    margin-top: 10px;
}

/* ─── Returning User Link ─── */
.returning-user-link {
    text-align: center;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.returning-user-link p {
    color: #666;
    font-size: 14px;
}

.returning-user-link a {
    color: #035aa6;
    font-weight: 600;
    text-decoration: none;
}

.returning-user-link a:hover {
    color: #dc1e5a;
    text-decoration: underline;
}

/* ─── Footer ─── */
.access-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.access-footer p {
    color: #999;
    font-size: 12px;
}

/* ═══════════════════════════════════════════════════════════
   ADMIN PANEL — Wide layout
   ═══════════════════════════════════════════════════════════ */

.admin-container {
    max-width: 1100px;
    padding: 30px;
}

.admin-header {
    padding-bottom: 15px;
    border-bottom: 2px solid #035aa6;
    margin-bottom: 20px;
}

.admin-header h1 {
    font-size: 22px;
}

.admin-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 20px;
}

/* ─── Admin Login Form ─── */
.admin-login-form {
    max-width: 360px;
    margin: 0 auto;
    padding: 20px 0;
}

.admin-login-form .form-group {
    margin-bottom: 15px;
}

/* ─── Table ─── */
.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table thead {
    background: #035aa6;
    color: #ffffff;
}

.admin-table th {
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.admin-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background: #f8f9fa;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.row-pending {
    background: #ffffff;
}

.row-used {
    background: #f9f9f9;
    opacity: 0.8;
}

.code-cell {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #035aa6;
    letter-spacing: 2px;
}

.empty-table {
    text-align: center;
    padding: 40px 20px !important;
    color: #999;
    font-style: italic;
}

/* ─── Badges ─── */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-used {
    background: #d4edda;
    color: #155724;
}

.text-muted {
    color: #aaa;
    font-size: 12px;
}

/* ─── Summary ─── */
.admin-summary {
    text-align: center;
    margin-top: 20px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #555;
    font-size: 14px;
}

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