Overview
This page documents the reusable component patterns found throughout the DNI Cita Previa application, including buttons, cards, forms, info boxes, and more.
Used for primary actions and main call-to-action elements.
.opcion-cita > a {
display : flex ;
flex-direction : row ;
justify-content : center ;
align-items : center ;
gap : 10 px ;
padding : 20 px 40 px ;
border-radius : 10 px ;
background-color : var ( --primary-blue );
color : var ( --white );
font-size : 15 px ;
font-weight : bold ;
cursor : pointer ;
transition : all 0.3 s ease ;
}
.opcion-cita > a :hover {
opacity : .9 ;
scale : .99 ;
}
Usage: Main action buttons on index and iniciar-solicitud pages.
Used for alternative or less emphasized actions.
.opcion-cita:nth-child ( 2 ) > a {
background-color : var ( --border-light );
color : var ( --text-gray-dark );
}
#btn-continuar {
background-color : var ( --primary-blue );
color : var ( --white );
}
#btn-continuar:hover {
background-color : var ( --primary-blue-dark );
opacity : .9 ;
scale : .99 ;
}
#btn-volver {
background-color : var ( --border-light );
color : var ( --text-gray );
}
#btn-volver:hover {
background-color : var ( --neutral-dark );
opacity : .9 ;
scale : .99 ;
}
Used for confirmation actions.
#btn-confirmar {
background-color : var ( --success-green );
color : var ( --white );
}
#btn-confirmar:hover {
background-color : var ( --success-green-dark );
opacity : .9 ;
scale : .99 ;
}
.botones-formulario {
display : flex ;
gap : 20 px ;
justify-content : center ;
margin-top : 30 px ;
flex-wrap : wrap ;
}
.botones-formulario a ,
.botones-formulario button {
display : flex ;
align-items : center ;
gap : 8 px ;
padding : 15 px 30 px ;
border : none ;
border-radius : 8 px ;
font-size : 16 px ;
font-weight : 600 ;
cursor : pointer ;
transition : all 0.3 s ease ;
min-width : 150 px ;
justify-content : center ;
}
Cards
Option Card
Used for presenting selectable options on the index and iniciar-solicitud pages.
#opciones-cita > div {
width : 50 % ;
background-color : var ( --white );
display : flex ;
flex-direction : column ;
justify-content : center ;
padding : 50 px ;
border-radius : 10 px ;
}
.opcion-cita > h2 {
margin-bottom : 20 px ;
color : var ( --primary-blue );
}
.opcion-cita > p {
margin-bottom : 15 px ;
color : var ( --text-gray-light );
}
Responsive behavior:
@media ( width <= 1024 px ) {
#opciones-cita > div {
width : 100 % ;
}
}
Summary Card
Used to display appointment confirmation and details.
.contenedor-resumen {
background-color : var ( --white );
border-radius : 10 px ;
padding : 30 px ;
margin-bottom : 30 px ;
box-shadow : 0 1 px 3 px rgba ( 0 , 0 , 0 , 0.1 );
text-align : left ;
}
#formulario-cita {
background-color : var ( --white );
border-radius : 10 px ;
padding : 30 px ;
margin-bottom : 30 px ;
box-shadow : 0 1 px 3 px rgba ( 0 , 0 , 0 , 0.1 );
}
.seccion-formulario {
margin-bottom : 40 px ;
text-align : left ;
}
.seccion-formulario h2 {
display : flex ;
align-items : center ;
gap : 10 px ;
color : var ( --primary-blue );
font-size : 1.3 rem ;
margin-bottom : 20 px ;
padding-bottom : 10 px ;
border-bottom : 2 px solid var ( --border-light );
}
.campo-formulario input ,
.campo-formulario select ,
.campo-formulario textarea {
width : 100 % ;
padding : 12 px 16 px ;
border : 2 px solid var ( --border-light );
border-radius : 8 px ;
font-size : 16 px ;
transition : border-color 0.3 s ease ;
box-sizing : border-box ;
}
.campo-formulario input :focus ,
.campo-formulario select :focus ,
.campo-formulario textarea :focus {
outline : none ;
border-color : var ( --primary-blue );
box-shadow : 0 0 0 3 px rgba ( 0 , 51 , 102 , 0.1 );
}
.campo-formulario input :invalid {
border-color : #ef4444 ;
}
.campo-formulario label {
display : block ;
margin-bottom : 8 px ;
font-weight : 600 ;
color : var ( --text-gray );
}
Textarea
.campo-formulario textarea {
resize : vertical ;
min-height : 100 px ;
}
.opciones-radio {
display : flex ;
flex-direction : column ;
gap : 10 px ;
margin-top : 10 px ;
}
.label-radio ,
.label-checkbox {
font-weight : normal ;
display : flex ;
align-items : center ;
gap : 8 px ;
}
.campo-formulario input [ type = "checkbox" ],
.campo-formulario input [ type = "radio" ] {
width : auto ;
padding : 0 ;
margin : 0 ;
cursor : pointer ;
}
.campos-fila {
display : flex ;
gap : 20 px ;
flex-wrap : wrap ;
}
.campos-fila .campo-formulario {
flex : 1 ;
min-width : 200 px ;
}
Info Box
Used to display important information or instructions.
.info {
margin-block : 30 px ;
display : flex ;
flex-direction : column ;
justify-content : center ;
gap : 10 px ;
background-color : var ( --bg-blue-light );
text-align : left ;
padding : 30 px ;
border-radius : 10 px ;
}
.info > h3 {
display : flex ;
flex-direction : row ;
gap : 15 px ;
align-items : center ;
color : var ( --primary-blue );
margin-bottom : 15 px ;
}
.info > div > p {
margin-bottom : 15 px ;
line-height : 1.6 ;
}
Status Indicator
Used to display appointment confirmation status.
.estado-cita {
text-align : center ;
padding : 30 px ;
margin-bottom : 40 px ;
background : linear-gradient ( 135 deg , var ( --bg-blue-light ) 0 % , var ( --bg-blue-lighter ) 100 % );
border-radius : 12 px ;
border : 2 px solid var ( --border-blue );
}
.icono-estado svg {
color : var ( --success-green );
width : 48 px ;
height : 48 px ;
}
.estado-cita h2 {
color : var ( --primary-blue );
margin : 0 0 10 px 0 ;
font-size : 1.5 rem ;
}
.codigo-cita strong {
color : var ( --primary-blue );
font-size : 1.2 rem ;
}
Table
Used for displaying key-value pairs in the summary page.
.tabla-resumen {
width : 100 % ;
border-collapse : collapse ;
margin-top : 10 px ;
}
.tabla-resumen td {
padding : 12 px 0 ;
border-bottom : 1 px solid var ( --border-lighter );
vertical-align : top ;
}
.tabla-resumen td :first-child {
color : var ( --text-gray-light );
font-weight : 500 ;
width : 35 % ;
padding-right : 20 px ;
}
.tabla-resumen td :last-child {
color : var ( --text-gray );
font-weight : 400 ;
}
.tabla-resumen tr :last-child td {
border-bottom : none ;
}
Navigation
nav {
display : flex ;
justify-content : center ;
align-items : center ;
}
ul {
display : flex ;
flex-direction : row ;
justify-content : center ;
flex-wrap : wrap ;
gap : 25 px ;
}
#menu-toggle {
display : none ;
}
@media ( width <= 480 px ) {
#menu-toggle {
display : flex ;
flex-direction : row ;
align-items : center ;
background-color : transparent ;
}
#menu-toggle > img {
width : 40 px ;
height : 40 px ;
}
nav {
display : none ;
width : 100 % ;
}
nav ul {
flex-direction : column ;
gap : 10 px ;
padding : 15 px 0 ;
}
}
Component Best Practices
Consistent Spacing Use consistent padding (30px for cards, 20px-50px for components) and gap values (10px, 15px, 20px, 25px)
Border Radius Standard border-radius values: 8px for small elements (inputs, buttons), 10px for cards, 12px for special containers
Transitions Use transition: all 0.3s ease for hover effects on interactive elements
Hover States Apply opacity: .9 and scale: .99 for subtle hover feedback on buttons
All interactive components should include focus states for accessibility, using the primary blue color with a subtle box-shadow.